public Consumer(IActorRef queue, IActorRef delegateTo)
{
_queue = queue;
Receive<int>(n => n <= current, n => Context.Stop(Self));
Receive<int>(n =>
{
current = n;
delegateTo.Tell(n);
});
Receive<PointToPointChannel.RegistrationOk>(x => delegateTo.Tell(x));
Receive<PointToPointChannel.UnexpectedRegistration>(x => delegateTo.Tell(x));
Receive<GetCurrent>(_ => Sender.Tell(current));
Receive<End>(_ => queue.Tell(PointToPointChannel.UnregisterConsumer.Instance));
Receive<PointToPointChannel.UnregistrationOk>(_ => Context.Stop(Self));
Receive<Ping>(_ => Sender.Tell(Pong.Instance));
}