unsubscribe in poke.rkt
This commit is contained in:
parent
223033f664
commit
1dec02fd3d
10
rmq/poke.rkt
10
rmq/poke.rkt
|
@ -42,6 +42,8 @@
|
|||
#:body (string->bytes/utf-8 (string-join strs)))]
|
||||
[(list "sub" topic)
|
||||
(spawn-subscriber topic)]
|
||||
[(list "unsub" topic)
|
||||
(unsubscribe-from topic)]
|
||||
[(list)
|
||||
(void)]
|
||||
[_
|
||||
|
@ -91,3 +93,11 @@
|
|||
`((hub.callback . "http://localhost:7000/sink")
|
||||
(hub.mode . "subscribe")
|
||||
(hub.topic . ,topic))))))
|
||||
|
||||
(define (unsubscribe-from topic)
|
||||
(request! 'post `("hub" ())
|
||||
#:body (string->bytes/utf-8
|
||||
(alist->form-urlencoded
|
||||
`((hub.callback . "http://localhost:7000/sink")
|
||||
(hub.mode . "unsubscribe")
|
||||
(hub.topic . ,topic))))))
|
||||
|
|
Loading…
Reference in New Issue