private void EnqueueInBuffer(object message)
{
var send = message as EndpointManager.Send;
if (send != null && send.Message is IPriorityMessage)
_prioBuffer.AddLast(send);
else if (send != null && send.Message is ActorSelectionMessage &&
send.Message.AsInstanceOf<ActorSelectionMessage>().Message is IPriorityMessage)
{
_prioBuffer.AddLast(send);
}
else
{
_buffer.AddLast(message);
}
}