DOC: clarify that TestActorRef can't be used with Stash
Also, improve the error handling for this case, since it throws NPE at Stash.mailbox
case other ⇒ throw ActorInitializationException(self, s"DequeBasedMailbox required, got: ${other.getClass.getName}\n"
context.asInstanceOf[ActorCell].mailbox.messageQueue is null for CallingThreadMailbox
case other ⇒ throw ActorInitializationException(self, s"DequeBasedMailbox required, got: ${other.getClass.getName}\n"
context.asInstanceOf[ActorCell].mailbox.messageQueue is null for CallingThreadMailbox
Leave a comment
on 2013-11-28 08:57 *
By bjorn.antonsson@typesafe.com
What would happen if the CallingThreadMailbox exposed the underlying queue? I guess stash and unstash would just wreck havoc with all the orderings and locks, since they would bypass them completely.
on 2013-11-29 07:40 *
By bjorn.antonsson@typesafe.com
One solution proposed on the akka user list is to define the stash methods abstract in the FSM actor and mix in Stash at runtime, or a TestStash for testing.
I was thinking that the TestStash could use normal tell operations to unstash things (yes it's not perfect).
I was thinking that the TestStash could use normal tell operations to unstash things (yes it's not perfect).
This was fixed in 2.3.0-RC1. Stash and TestActorRef can now be used together.