示例#1
0
文件: Debug.cs 项目: afrog33k/Excess
        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);
        }
示例#2
0
文件: Debug.cs 项目: afrog33k/Excess
        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);
        }
示例#3
0
文件: Debug.cs 项目: afrog33k/Excess
        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;
            }
        }
示例#4
0
文件: Debug.cs 项目: afrog33k/Excess
 public string Process(string what, GoodbyeService unGreeter)
 {
     return(Process(what, unGreeter, default(CancellationToken)).Result);
 }