Morning.
morning
Hello All :simple_smile:
is there a pattern/lib/datastructure to handle rapidly changing hash sets? I've got two incoming streams of data. One a stream of channels, and the other a stream of packets for those channels... I receive a channel, and then shortly after I expect a data packet for that given channel. Currently I'm just storing the channels in an atom containing a map and doing swap! constantly.
is there a better way. Seems kinda... clunky?
so you get a channel (with an id of some sort?) and then a packet for the channel (also with an id for channel?) put the packet on the channel, then what happens to the channel ? close or await further packets ?
close it
atom/swap! doesn't seem unreasonable to me... agents could also be useful, though unless you need the STM stuff they probably aren't doing anything for you over atom/swap!
hmm. ok. ta
though agents do the thread-pool stuff themselves, so that may be useful
and if you are on cljs rather than clj then there is only atom :simple_smile:
yeah, this is actual-clojure
will look into agents tho, sounds like it might make it cleaner
well that was easy
agents ?
yeah, and the channel-matching