Hey all, I’m trying to write a graphql API along with redis pub/sub functionality with lacinia and carmine.
According to the docs I understood how the basic listener and channel initialization works.
(def listener
(car/with-new-pubsub-listener (:spec server1-conn)
{"foobar" (fn f1 [msg] (println "Channel match: " msg))}
(car/subscribe "foobar")))
This is how the channel is made and we can publish data into this channel via
(wcar* (car/publish "foobar" "Hello to foobar!"))
But how can we retrieve the data out of this channel? and what’s this part?
(with-open-listener listener
(car/unsubscribe) ; Unsubscribe from every channel (leave patterns alone)
(car/psubscribe "an-extra-channel"))
(swap! (:state listener) assoc "*extra*" (fn [x] (println "EXTRA: " x)))