Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 public override ITask FromPredicate(System.Func <bool> poller, string name)
 {
     return(Enqueue(EnumerableAction.Create(poller)));
 }
Esempio n. 4
0
 public ITask Enqueue(System.Func <IEnumerator> enumerableAction, string name = "")
 {
     return(Enqueue(EnumerableAction.Create(enumerableAction, 1, name)));
 }
Esempio n. 5
0
 public ITask FromEnumerableAction(System.Func <IEnumerator> routine)
 {
     return(FromEnumerableAction(EnumerableAction.Create(routine)));
 }