public void Process(string what, GoodbyeService unGreeter, CancellationToken cancellation, Action <object> success, Action <Exception> failure) { var __success = success; var __failure = failure; var __cancellation = cancellation; __enter(() => __advance(__concurrentProcess(what, unGreeter, __cancellation, __success, __failure).GetEnumerator()), failure); }
public Task <string> Process(string what, GoodbyeService unGreeter, CancellationToken cancellation) { var completion = new TaskCompletionSource <string>(); Action <object> __success = (__res) => completion.SetResult((string)__res); Action <Exception> __failure = (__ex) => completion.SetException(__ex); var __cancellation = cancellation; __enter(() => __advance(__concurrentProcess(what, unGreeter, __cancellation, __success, __failure).GetEnumerator()), __failure); return(completion.Task); }
private IEnumerable <Expression> __concurrentProcess(string what, GoodbyeService unGreeter, CancellationToken __cancellation, Action <object> __success, Action <Exception> __failure) { string goodbyeText; { var __expr1_var = new __expr1 { Start = (___expr) => { var __expr = (__expr1)___expr; unGreeter.Goodbye(what, __cancellation, (__res) => { __expr.goodbyeText = (String)__res; __expr.__op1(true, null, null); } , (__ex) => __expr.__op1(false, null, __ex)); __expr.__op1(null, false, null); } , End = (__expr) => { __enter(() => __advance(__expr.Continuator), __failure); } }; yield return(__expr1_var); if (__expr1_var.Failure != null) { throw __expr1_var.Failure; } goodbyeText = __expr1_var.goodbyeText; } { __dispatch("Process"); if (__success != null) { __success(what + " then " + goodbyeText); } yield break; } }
public string Process(string what, GoodbyeService unGreeter) { return(Process(what, unGreeter, default(CancellationToken)).Result); }