pool
pool copied to clipboard
A class for managing a finite pool of resources.
This PR exposes `_maxAllocatedResources`, `_allocatedResources` and an extra property `hasAvailableResources` to be able to inspect the current status of the pool. This can be useful for short-curcuiting a request for...
What is the proper way to handle an Exceception from a queued function: How to clear all queued functions and to stop the pool? The following code catches the Exception....
What is the best way to prematurely cancel and dispose of all remaining pool tasks and cleanly close the pool without waiting for the tasks to complete?
The pub site can show example code for a package. https://www.dartlang.org/tools/pub/package-layout#examples Let me know if you want me to try working on this. related issue : dart-lang/site-www#413
`withResource` is defined as: `Future withResource(FutureOr Function() callback) ` Method body has this line: `return await callback();` From my understanding the correct way to write that is something like: ```dart...
This would be useful to check if the "worker pool" after a certain timeout is "finished" with all the tasks. Example of use case: ```dart import 'dart:async'; import 'dart:collection'; import...
For example: ```dart R Function(P1, P2) limit2(R Function(P1, P2) callback) => (p1, p2) => withResource(() => callback(p1, p2)); ``` This would make it easier to use pools for use cases...