executor 2.2.3 copy "executor: ^2.2.3" to clipboard
executor: ^2.2.3 copied to clipboard

Executes async tasks with a configurable maximum concurrency and rate.

example/example.dart

// Copyright (c) 2017, Agilord. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.

import 'dart:async';

import 'package:executor/executor.dart';

Future main() async {
  final executor = Executor(concurrency: 10);
  // only 10 of them will be running at a time
  for (var i = 0; i < 20; i++) {
    // ignore: unawaited_futures
    executor.scheduleTask(() async {
      // await longDatabaseTask()
      // await anotherProcessing()
    });
  }

  await executor.join(withWaiting: true);
  await executor.close();
}
26
likes
130
pub points
85%
popularity

Publisher

verified publisheragilord.com

Executes async tasks with a configurable maximum concurrency and rate.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

stack_trace

More

Packages that depend on executor