public AsyncStep( BeginCall beginCall, EndCall endCall, Call call, ExceptionPolicy policy) { this.policy = policy; this.beginCall = beginCall; this.endCall = endCall; this.call = call; }
public ParallelAsyncResult(TIteratorAsyncResult iteratorAsyncResult, ICollection <TWorkItem> workItems, BeginCall <TWorkItem> beginCall, EndCall <TWorkItem> endCall, TimeSpan timeout, AsyncCallback callback, object state) : base(callback, state) { this.iteratorAsyncResult = iteratorAsyncResult; this.workItems = workItems; this.endCall = endCall; this.actions = this.workItems.Count + 1; foreach (TWorkItem source in workItems) { try { beginCall(iteratorAsyncResult, source, timeout, completed, new CallbackState(this, source)); } catch (Exception e) { TryComplete(e, true); } } TryComplete(null, true); }
protected AsyncStep CallAsync(BeginCall beginCall, EndCall endCall, ExceptionPolicy policy) { return(new AsyncStep(beginCall, endCall, null, policy)); }
protected AsyncStep CallParallelAsync <TWorkItem>(ICollection <TWorkItem> workItems, BeginCall <TWorkItem> beginCall, EndCall <TWorkItem> endCall, TimeSpan timeout, ExceptionPolicy policy) { return(this.CallAsync( (thisPtr, t, c, s) => new ParallelAsyncResult <TWorkItem>(thisPtr, workItems, beginCall, endCall, timeout, c, s), (thisPtr, r) => ParallelAsyncResult <TWorkItem> .End(r), policy)); }
public static AsyncStep CallParallel(BeginCall begin, EndCall end) { return(new AsyncStep(begin, end, true)); }
public static AsyncStep CallParallel(BeginCall begin, EndCall end, IAsyncCatch[] catches) { return(new AsyncStep(begin, end, true, catches)); }
public static AsyncStep CallAsync(BeginCall begin, EndCall end, IAsyncCatch[] catches) { return(new AsyncStep(begin, end, false, catches)); }
public static AsyncStep CallAsync(BeginCall begin, EndCall end) { return(new AsyncStep(begin, end, false)); }
public AsyncStep(BeginCall begin, EndCall end, bool isParallel, IAsyncCatch[] catches) : this(begin, end, isParallel) { this.Catches = catches; }
public AsyncStep(BeginCall begin, EndCall end, bool isParallel) { this.Begin = begin; this.End = end; this.IsParallel = isParallel; }
public void Call(int number) { BeginCall?.Invoke(this, new CallEventArgs(number)); }