public ITask Parallelize(ICollection <ITask> tasks) { string name = string.Format("parallelization of {0} tasks", tasks.Count); IEnumerableAction serialAction = EnumerableAction.Create(() => StartParallelTasks(tasks), tasks.Count, name); return(this.FromEnumerableAction(serialAction)); }
public ITask Parallelize(System.Func <bool> poller, float timeout = -1f, string name = "") { IEnumerableAction action = EnumerableAction.Create(() => WaitOnCondition(poller), 1, name); QueueTask task = new QueueTask(this, action) { RequestedTimeout = timeout }; lock (_lock) { _tasks.Enqueue(task); } return(task); }
public override ITask FromPredicate(System.Func <bool> poller, string name) { return(Enqueue(EnumerableAction.Create(poller))); }
public ITask Enqueue(System.Func <IEnumerator> enumerableAction, string name = "") { return(Enqueue(EnumerableAction.Create(enumerableAction, 1, name))); }
public ITask FromEnumerableAction(System.Func <IEnumerator> routine) { return(FromEnumerableAction(EnumerableAction.Create(routine))); }