Open vvvvalvalval opened 6 years ago
Will need a lil more hammock time, in the meantime brk
not supported in CLJS.
There's not necessarily a big demand for scope-capture providing non-blocking breakpoints, as it's already provided by Dirac: https://github.com/binaryage/dirac
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