You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to make breakpoints available to non-blocking execution environments such as ClojureScript, the macro-expansion of sc.api/brk needs to be customized by some green-threading mechanism.
Currently, the most popular / official green threading mechanism would be core.async's go and <!, i.e the macro-expansion of (sc.api/brk expr) would expand to something like:
Of course, for this to work, the (brk ...) call should be placed inside a go block.
I'm reluctant to use this approach, for several reasons:
core.async's not that portable, e.g it's currently not supported on self-hosted CLJS
it's prescriptive about the green threading mechanism used; core.async's go is currently the most popular, but it may not always be so in the future, and other such as promesa's or manifold's are desirable as well
it imposes to distinguish the emission for Clojure and for ClojureScript, which is always a bit hacky.
Another solution would be to let the client register and use their own strategies for green-threading, by registering a hook in brk. Such strategies could be registered for core.async, manifold, promesa, etc. Examples:
In order to make breakpoints available to non-blocking execution environments such as ClojureScript, the macro-expansion of
sc.api/brk
needs to be customized by some green-threading mechanism.Currently, the most popular / official green threading mechanism would be core.async's
go
and<!
, i.e the macro-expansion of(sc.api/brk expr)
would expand to something like:Of course, for this to work, the
(brk ...)
call should be placed inside a go block.I'm reluctant to use this approach, for several reasons:
Another solution would be to let the client register and use their own strategies for green-threading, by registering a hook in
brk
. Such strategies could be registered for core.async, manifold, promesa, etc. Examples:clojure.core promise / deliver / deref:
core.async go / <!
Promesa alet / await
The text was updated successfully, but these errors were encountered: