angel_task 1.0.0 copy "angel_task: ^1.0.0" to clipboard
angel_task: ^1.0.0 copied to clipboard

outdated

Support for running asynchronous jobs within Angel. Ideal for large applications.

task #

version 1.0.0

Support for running and scheduling asynchronous tasks within Angel.

Coming soon: Trigger tasks within route handlers. This will require communication between isolates, and will be present by the next release!

main() async {
  var app = await createApp();
  var scheduler = new AngelTaskScheduler(app);

  scheduler.once((Todo singleton) {
    print('3 seconds later, we found our Todo singleton: "${singleton.text}"');
  }, new Duration(seconds: 3));

  Task foo;
  int i = 0;

  foo = scheduler.seconds(1, () {
    print('Printing ${++i} time(s)!');

    if (i >= 3 && false) {
      print('Cancelling foo task...');
      foo.cancel();
    }
  });

  await scheduler.start();
}
0
likes
0
pub points
0%
popularity

Publisher

unverified uploader

Support for running asynchronous jobs within Angel. Ideal for large applications.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

angel_common, pool, sync, uuid

More

Packages that depend on angel_task