Fork me on GitHub

nice post, very relevant to what I am doing


I chose to implement some very basic/primitive "scheduling" myself, but I still use alts! for purposes of control channels vs. input channels and such. The scheduling though isn't true scheduling so much as deciding when to read or write to channels via work queues with/without priorities and some basic metrics. I use the control channels as a way of forcing any go-loops I have doing work to park on the control channel. So in a sense, I have "play" and "pause" as well as "mute" and "flush" semantics to help with all of this. Gives me enough control for now for my purposes dealing with processing streams, http calls, etc.


I can't really truly pre-empt anything at any point in execution, but enough so that I can interrupt a function and pause where I do my alts! or in some cases at a few specific other points (example: toggling a throttle on/off)


I think using something like component/defrecord can help with the "encapsulation" part a bit


(i use component)


I really do wish core.async was baked in at a lower-level like go, but I'd also rather have the jvm than go for now


and for that matter the rest of clojure