Explicit requeue of messages not matching the current PartialFunction
Should put on another queue, which should be revisited every 'become'.
In ActorRef:
In user Actor:
And on 'become' and 'unbecome' do:
In ActorRef:
def requeue = mailboxForNotYetDefinedMessages.add(msg)
In user Actor:
def receive = { case _ => self.requeue }
And on 'become' and 'unbecome' do:
val msg = mailboxForNotYetDefinedMessages.poll if (msg != null && receive.isDefinedAt(msg)) receive(msg)
Leave a comment
on 2010-10-10 17:42 *
By Jonas Bonér
Description changed from Should put on another queue... to Should put on another queue...
Summary changed from Explicit enqueue of messages not matching the current PartialFunction to Explicit requeue of messages not matching the current PartialFunction
on 2010-11-08 02:44 *
By viktorklang
This can now be implemented on top of Actor.unhandled(msg)
Superceded by the becomeOnce ticket