ldnclj

Find us on #clojure-uk
agile_geek 2016-02-04T07:47:16.000256Z

Morning.

thomas 2016-02-04T09:25:52.000257Z

morning

maleghast 2016-02-04T13:57:16.000258Z

Hello All :simple_smile:

xlevus 2016-02-04T14:21:17.000259Z

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.

xlevus 2016-02-04T14:21:46.000260Z

is there a better way. Seems kinda... clunky?

mccraigmccraig 2016-02-04T14:23:17.000261Z

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 ?

xlevus 2016-02-04T14:23:57.000262Z

close it

mccraigmccraig 2016-02-04T14:27:49.000264Z

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!

xlevus 2016-02-04T14:28:06.000265Z

hmm. ok. ta

mccraigmccraig 2016-02-04T14:28:29.000266Z

though agents do the thread-pool stuff themselves, so that may be useful

mccraigmccraig 2016-02-04T14:29:11.000267Z

and if you are on cljs rather than clj then there is only atom :simple_smile:

xlevus 2016-02-04T14:29:34.000268Z

yeah, this is actual-clojure

xlevus 2016-02-04T14:29:47.000269Z

will look into agents tho, sounds like it might make it cleaner

xlevus 2016-02-04T14:59:22.000270Z

well that was easy

mccraigmccraig 2016-02-04T15:26:56.000271Z

agents ?

xlevus 2016-02-04T15:30:38.000272Z

yeah, and the channel-matching