onNext() public method

public onNext ( RpcAsyncContext ctx, RpcPromise from = null ) : void
ctx RpcAsyncContext
from RpcPromise
return void
Beispiel #1
0
 private void onFinally(RpcAsyncContext ctx)
 {
     _currentNext = _finally;
     if (_finally != null)
     {
         _finally(ctx);
     }
     if (_nextPromise != null)
     {
         _nextPromise.onNext(ctx, this);
     }
 }
Beispiel #2
0
        public void onError(RpcAsyncContext ctx)
        {
            if (_errorlist.Count == 0)
            {
                onFinally(ctx);
                return;
            }
            // pick out one fork-promise
            KeyValuePair <RpcPromise, OnNext> kv = _errorlist[0];
            OnNext     succ = kv.Value;
            RpcPromise next = kv.Key;

            _errorlist.RemoveAt(0);
            // scan list and remove all nodes which's depth of node is less than promise.
            int index = _sucesslist.IndexOf(succ);

            _sucesslist.RemoveRange(0, index + 1);

            if (next != null)
            {
                ctx.promise = next;
                next.onNext(ctx);
            }
        }