Пример #1
0
            public override void OnPull()
            {
                var t = _stage.UnfoldFunc(_state);

                if (!t.HasValue)
                {
                    Complete(_stage.Out);
                }
                else
                {
                    Push(_stage.Out, t.Value.Item2);
                    _state = t.Value.Item1;
                }
            }
Пример #2
0
            public override void OnPull()
            {
                var t = _stage.UnfoldFunc(_state);

                if (t == null)
                {
                    Complete(_stage.Out);
                }
                else
                {
                    Push(_stage.Out, t.Item2);
                    _state = t.Item1;
                }
            }
Пример #3
0
            public Logic(Unfold <TState, TElement> stage) : base(stage.Shape)
            {
                _stage = stage;
                var state = _stage.State;

                SetHandler(_stage.Out, onPull: () =>
                {
                    var t = _stage.UnfoldFunc(state);
                    if (t == null)
                    {
                        Complete(_stage.Out);
                    }
                    else
                    {
                        Push(_stage.Out, t.Item2);
                        state = t.Item1;
                    }
                });
            }