Fork me on GitHub
#core-async
<
2016-02-26
>
hugesandwich14:02:23

nice post, very relevant to what I am doing

hugesandwich14:02:51

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.

hugesandwich14:02:54

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)

hugesandwich14:02:26

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

hugesandwich14:02:32

(i use component)

hugesandwich14:02:24

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

hugesandwich14:02:32

and for that matter the rest of clojure