Closed lgrapenthin closed 5 years ago
Could you elaborate on this ? setTimeout
and g.a.nextTick
don't have the same semantics, and we still need setTimeout
for non-null delays. Are you suggesting we check null delays and use g.a.nextTick
as an optimization in this case ? Why not complete synchronously instead ?
You are right, I completely misremembered/confused a few things about this in core.async. It appears core.async hasn't addressed the 4 ms problem directly, but they use a skiplist to squash a timeout if it happens less than 10ms after another. It might not be relevant here, feel free to close.
https://google.github.io/closure-library/api/goog.async.nextTick.html
Its preferable over setTimeout, because setTimeout induces a 4ms delay.