Docstring says "Items received when there are no matching subs get dropped."
You would have to implement your own version of the Pub interface which caches all messages and broadcasts them all to a newly subscribed channel within sub. Notice that an unlimited cache would imply a possible memory leak. It is highly questionable whether this solution is a good fit for the underlying problem you are trying to solve. It is more likely that it would solve a problem resulting from a synchronization problem which should be solved elsewhere. On Tuesday, February 24, 2015 at 10:51:41 PM UTC+1, Cristian C wrote: > > My test case would be something like this: > > ;; I have a channel that I want to wrap in a publication > (def publisher (async/chan)) > (def publication (async/pub publisher :topic)) > > ;; then I put data into the publisher channel > (async/put! publisher {:topic :foo :payload "first message"}) > > ;; then I create a channel to read data from that publication > (def reader (async/chan)) > (async/sub publication :foo reader) > (async/go (println "value is: " (async/<! reader))) > > ;; nothing happens since the publication already read the value and > dropped it > > ;; if I send another message, this time it will be read by the <! above > (async/put! c1 {:topic :foo :msg "second message"}) > ==> value is {:topic :foo :msg "second message"} > > Is there a way not to lose that first item? > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.