v2.2.5
executor
以可配置的最大并发性和速率执行异步任务。
33喜欢 1.8万近 30 天下载160Pub 分数
AndroidiOSWebmacOSWindowsLinux
Dart 的异步任务执行器
>=1.9.0 <2.0.0^5.0.0^1.3.0以下为英文项目原文快照,最新内容请访问 GitHub。
Executes async tasks with a configurable maximum concurrency and rate.
A simple usage example:
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();