Fork me on GitHub
#core-async
<
2016-06-22
>
darwin19:06:06

Hi, just wanted to share with you a half-baked idea which enables long stack traces for core.async in ClojureScript: You can get this[1] instead of this[2]: [1] https://dl.dropboxusercontent.com/u/559047/core-async-long-stack-traces.png [2] https://dl.dropboxusercontent.com/u/559047/core-async-normal-traces.png

darwin19:06:34

The trick is to replace goog.async.nextTick with a promise-based implementation. ES6 promises participate in Chrome DevTools “async” feature.

darwin19:06:19

it is not super useful ATM, because maxAsyncStackChainDepth is currently hard-coded in DevTools and set to only 4, which is not enough for more complex core.async code: https://github.com/binaryage/dirac/blob/devtools/front_end/sdk/DebuggerModel.js#L200 but in Dirac I can lift that number and maybe walk the call stack in a better way, so loops won’t create long stack traces

darwin23:06:49

here is an upstream proposal how to handle long async-task chains generated by core.async: https://bugs.chromium.org/p/chromium/issues/detail?id=622506