public Schedulable <T> AddCoroutine(IScheduler scheduler, Func <IEnumerator> starter) { var func = CoroutineFunctor.Create(() => default(T), _ => starter()); var schedulable = new Schedulable <T>(scheduler, func); AddChild(schedulable); return(schedulable); }
public Schedulable <T> ContinueWithCoroutine(IScheduler scheduler, Func <IEnumerator> starter) { if (Parent == null) { throw new NoParentException(); } var func = CoroutineFunctor.Create(() => default(T), _ => starter()); var schedulable = new Schedulable <T>(scheduler, func); Parent.AddChild(schedulable); return(schedulable); }
public Schedulable <U> ContinueWithCoroutine <U>(IScheduler scheduler, Func <T, IEnumerator> starter) { if (Parent == null) { throw new NoParentException(); } Func <T> getResult = null; if (Func != null) { getResult = Func.GetResult; } var func = CoroutineFunctor.Create <T, U>(getResult, starter); var schedulable = new Schedulable <U>(scheduler, func); Parent.AddChild(schedulable); return(schedulable); }