public void Then(System.Func <T1, T2, Task> task, T1 param1, T2 param2) { Promise <T1, T2> promise = new Promise <T1, T2>(); promise.And(task, param1, param2); _promises.Enqueue(promise); _lastAdded = promise; }
public void And(System.Func <T1, T2, Task> task, T1 param1, T2 param2) { if (_promises.Count == 0) { Then(task, param1, param2); return; } _lastAdded.And(task, param1, param2); }