Bump dart-lang/setup-dart from 1.4.0 to 1.5.0 (#67)

Bumps [dart-lang/setup-dart](https://github.com/dart-lang/setup-dart) from 1.4.0 to 1.5.0.
- [Release notes](https://github.com/dart-lang/setup-dart/releases)
- [Changelog](https://github.com/dart-lang/setup-dart/blob/main/CHANGELOG.md)
- [Commits](https://github.com/dart-lang/setup-dart/compare/a57a6c04cf7d4840e88432aad6281d1e125f0d46...d6a63dab3335f427404425de0fbfed4686d93c4f)

---
updated-dependencies:
- dependency-name: dart-lang/setup-dart
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 file changed
tree: 4d5d1f90466f16ff31a92279721256ccc023eaec
  1. .github/
  2. benchmark/
  3. lib/
  4. test/
  5. .gitignore
  6. analysis_options.yaml
  7. CHANGELOG.md
  8. LICENSE
  9. pubspec.yaml
  10. README.md
README.md

Dart CI pub package package publisher

The pool package exposes a Pool class which makes it easy to manage a limited pool of resources.

The easiest way to use a pool is by calling withResource. This runs a callback and returns its result, but only once there aren't too many other callbacks currently running.

// Create a Pool that will only allocate 10 resources at once. After 30 seconds
// of inactivity with all resources checked out, the pool will throw an error.
final pool = new Pool(10, timeout: new Duration(seconds: 30));

Future<String> readFile(String path) {
  // Since the call to [File.readAsString] is within [withResource], no more
  // than ten files will be open at once.
  return pool.withResource(() => new File(path).readAsString());
}

For more fine-grained control, the user can also explicitly request generic PoolResource objects that can later be released back into the pool. This is what withResource does under the covers: requests a resource, then releases it once the callback completes.

Pool ensures that only a limited number of resources are allocated at once. It‘s the caller’s responsibility to ensure that the corresponding physical resource is only consumed when a PoolResource is allocated.

class PooledFile implements RandomAccessFile {
  final RandomAccessFile _file;
  final PoolResource _resource;

  static Future<PooledFile> open(String path) {
    return pool.request().then((resource) {
      return new File(path).open().then((file) {
        return new PooledFile._(file, resource);
      });
    });
  }

  PooledFile(this._file, this._resource);

  // ...

  Future<RandomAccessFile> close() {
    return _file.close.then((_) {
      _resource.release();
      return this;
    });
  }
}