示例#1
0
            public Logic(BackpressureTimeout <T> stage) : base(stage.Shape)
            {
                _stage        = stage;
                _nextDeadline = DateTime.UtcNow.Ticks + stage.Timeout.Ticks;

                SetHandler(stage.Inlet, this);
                SetHandler(stage.Outlet, this);
            }
示例#2
0
文件: Timers.cs 项目: yfer/akka.net
            public Logic(BackpressureTimeout <T> stage) : base(stage.Shape)
            {
                _stage        = stage;
                _nextDeadline = DateTime.UtcNow.Ticks + stage.Timeout.Ticks;

                SetHandler(stage.Inlet, onPush: () =>
                {
                    Push(stage.Outlet, Grab(stage.Inlet));
                    _nextDeadline  = DateTime.UtcNow.Ticks + stage.Timeout.Ticks;
                    _waitingDemand = true;
                });
                SetHandler(stage.Outlet, onPull: () =>
                {
                    _waitingDemand = false;
                    Pull(stage.Inlet);
                });
            }