public void Can_use_unbounded_priority_mailbox()
{
var actor = Sys.ActorOf(EchoActor.Props(this).WithMailbox("string-prio-mailbox"), "echo");
//pause mailbox until all messages have been told
actor.Tell(Suspend.Instance);
actor.Tell(true);
for (var i = 0; i < 30; i++)
{
actor.Tell(1);
}
actor.Tell("a");
actor.Tell(2.0);
for (var i = 0; i < 30; i++)
{
actor.Tell(1);
}
actor.Tell(new Resume(null));
//resume mailbox, this prevents the mailbox from running to early
//priority mailbox is best effort only
ExpectMsg("a");
ExpectMsg(true);
for (var i = 0; i < 60; i++)
{
ExpectMsg(1);
}
ExpectMsg(2.0);
ExpectNoMsg(TimeSpan.FromSeconds(0.3));
}