예제 #1
0
        public WaitResultInstruction()
        {
            var ch = Chan <T> .Make();

            ch.Receive(
                (result, ok) =>
            {
                if (ok)
                {
                    _result = result;
                }
                _keepWaiting = false;
            }
                );
        }
예제 #2
0
        public ForInstruction(Action <T> onReceive)
        {
            var ch = Chan <T> .Make();

            ch.Receive(
                (t, ok) =>
            {
                if (!ok)
                {
                    _keepWaiting = false;
                    return;
                }
                onReceive(t);
            }
                );
        }