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();