Closed pdenno closed 5 years ago
I don't know whether what I wrote above, the need to specify a thread for s/consume, is an issue or not, but I've found that that wasn't the problem in this case. The problem was that under certain circumstances the server with the websocket was suspending transmission.
Hi,
Thank you for this wonderful library!
I have a web socket bus/publish! messages to an event bus using s/consume, and a bus/subscribe stream that will pick up them up. This latter stream also uses s/consume and its callback will d/success! a deferred, dee, when it sees what it is looking for.
(-> (d/chain dee (fn [d] (log/info "Waiting on" d) d)) (d/timeout! 5000) (deref))
The problem is that the deref here will pause the s/consume on the event bus, so the subscriber stream doesn't see any new messages. What I want, I think, is to provide a thread for the s/consume that is listening on the web socket and publishing to the event bus. But I don't see how to do it. Just wrapping the s/consume in a d/future doesn't help.