pool
pool copied to clipboard
Add `limitN` functions to wrap callbacks
For example:
R Function(P1, P2) limit2<P1, P2>(R Function(P1, P2) callback) =>
(p1, p2) => withResource(() => callback(p1, p2));
This would make it easier to use pools for use cases like https://github.com/dart-lang/graphs/issues/39, wrapping in 2 levels of closures in place is pretty ugly.
thoughts @kevmoo @jakemac53
This should be a language feature. Thinking of all of the flavors of bind
we have in the Zone API...
https://github.com/dart-lang/language/issues/157