Source
WorkerPool createWorkerPool(int count, WorkerFunction function, {Map<String, dynamic> metadata}) { var workers = <WorkerSocket>[]; for (var i = 1; i <= count; i++) { workers.add( createWorker(function, metadata: { "workerId": i }..addAll(metadata == null ? {} : metadata))); } return new WorkerPool(workers); }