31 ms·
You won't know which channel is going to give you a value ahead of time, it depends on runtime conditions. But really, you don't care if the user pushes the ke
by sgrove 13y ago
You won't know which channel is going to give you a value ahead of time, it depends on runtime conditions.
But really, you don't care if the user pushes the keyboard or moves the mouse first, you just want to handle each event as it happens in essentially a sequential manner.
- realrocker 13y agoIf I am forcing it to be sequential, aren't the choices now determinitic?
- brandonbloom 13y agoThe default for multiplexing is non-deterministic choice. You can specify the :priority flag [1] if you want deterministic choice when multiplexing. Reads and writes will block for a non-deterministic amount of time, but their sequencing will be deterministic. That's the beauty of the CSP model: You can achieve some level of local determinism within a particular thread of control. Makes it much easier to reason about the non-deterministic outside world. [1]: https://github.com/clojure/core.async/blob/bb77337b3e9ce2118916fe84ae37c064a2eb9c55/src/main/clojure/clojure/core/async.clj#L229 https://github.com/clojure/core.async/blob/bb77337b3e9ce2118...
- realrocker 13y agomakes sense , thank you!