Akka.Streams.Tests.Actor.Streamer.Receive C# (CSharp) Method

Receive() protected method

protected Receive ( object message ) : bool
message object
return bool
        protected override bool Receive(object message)
        {
            return message.Match()
                .With<OnNext>(next =>
                {
                    var msg = (Msg)next.Element;
                    _queue.Add(msg.Id, msg.ReplyTo);
                    if (_queue.Count > 10)
                        throw new InvalidOperationException($"queued too many: {_queue.Count}");
                    _router.Route(new Work(msg.Id), Self);
                })
                .With<Reply>(reply =>
                {
                    _queue[reply.Id].Tell(new Done(reply.Id));
                    _queue.Remove(reply.Id);
                })
                .WasHandled;
        }
    }