pool icon indicating copy to clipboard operation
pool copied to clipboard

expose resources

Open aeb-dev opened this issue 1 year ago • 1 comments

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 example:

var p = Pool(1);

var pr = await p.request();

if (!p.hasAvailableResources) {
  return;
}

var pr2 = await p.request();

This PR also fixes #33


  • [x] I’ve reviewed the contributor guide and applied the relevant portions to this PR.
Contribution guidelines:

Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.

aeb-dev avatar May 29 '23 01:05 aeb-dev

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar May 29 '23 01:05 google-cla[bot]