public Logic(BidiShape <int, int, int, int> shape) : base(shape)
                {
                    SetHandler(shape.Inlet1,
                               onPush: () => Push(shape.Outlet1, Grab(shape.Inlet1)),
                               onUpstreamFinish: () => Complete(shape.Outlet1));

                    SetHandler(shape.Inlet2,
                               onPush: () => Push(shape.Outlet2, Grab(shape.Inlet2)),
                               onUpstreamFinish: () => Complete(shape.Outlet2));

                    SetHandler(shape.Outlet1,
                               onPull: () => Pull(shape.Inlet1),
                               onDownstreamFinish: () => Cancel(shape.Inlet1));

                    SetHandler(shape.Outlet2,
                               onPull: () => Pull(shape.Inlet2),
                               onDownstreamFinish: () => Cancel(shape.Inlet2));
                }
Exemple #2
0
 /// <summary>
 /// TBD
 /// </summary>
 /// <param name="timeout">TBD</param>
 public IdleTimeoutBidi(TimeSpan timeout)
 {
     Timeout = timeout;
     Shape   = new BidiShape <TIn, TIn, TOut, TOut>(In1, Out1, In2, Out2);
 }
Exemple #3
0
 public One2OneBidi(int maxPending)
 {
     _maxPending = maxPending;
     Shape       = new BidiShape <TIn, TIn, TOut, TOut>(_inInlet, _inOutlet, _outInlet, _outOutlet);
 }