Asynchronizer — my first attempt at a system for modeling non-blocking loops in JavaScript — had a lot of shortcomings, so I rethought it, rewrote it from scratch, and renamed it. Clumpy is its successor.
What I called “dynamic clumping” in Asynchronizer now happens transparently in Clumpy, and is no longer confined to a single loop at a time. The end of one loop and the beginning of the next might happen in the same clump.
The syntax more closely resembles real loops. Explicit continue is no longer required. Loops can have labels now, and you can break or continue by label. Chaining follows a more natural pattern also: instead of passing several functions to a chain method, each method can be chained off the last.
Finally, I wrote better documentation.
Feel free to post feedback, bug reports, etc. here.
2 Responses
I noticed this in one of the examples: "function (k) { key = k; ..."
Shouldn't that just be "function (key) { ..."?
It's to more closely mimic the behavior of a real
for...in
loop, wherekey
's scope extends outside the block.It's explained in the usage guide, but I should also explain it in the reference.