generic_pool 0.0.1 copy "generic_pool: ^0.0.1" to clipboard
generic_pool: ^0.0.1 copied to clipboard

outdated

A starting point for Dart libraries or applications.

generic_pool #

Usage #

import 'package:generic_pool/generic_pool.dart' as pool;

main() async {
  var dial = () async {
    print('+1');
    return 'a';
  };

  var close = (dynamic c) async {
    print('-1');
  };

  var cc = pool.pool(dial, close, 1, maxActive: 2);
  try {
    await cc.get();
    await cc.get();
    var x = await cc.get();
    await cc.get();
    print(x);
    await cc.put(x, false);
    print(cc.activeCount);
    var xx = await cc.get();
    await cc.put(xx, true);
    print(cc.activeCount);
  } on Exception catch (e) {
    print(e == pool.ErrPoolExhausted);
  }
}
0
likes
0
pub points
0%
popularity

Publisher

unverified uploader

A starting point for Dart libraries or applications.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

More

Packages that depend on generic_pool