Skip to content

Instantly share code, notes, and snippets.

@rpt
Created June 7, 2016 12:49
Show Gist options
  • Save rpt/6a29c7645ca6575f0137e172102f89a7 to your computer and use it in GitHub Desktop.
Save rpt/6a29c7645ca6575f0137e172102f89a7 to your computer and use it in GitHub Desktop.
import akka.actor.{ActorRef, ActorSystem}
import akka.dispatch.{Envelope, MailboxType, MessageQueue, ProducesMessageQueue}
class MyMailbox extends MailboxType with ProducesMessageQueue[MyMailbox.MyMessageQueue] {
def create(owner: Option[ActorRef], system: Option[ActorSystem]): MessageQueue = ???
}
object MyMailbox {
trait MyMessageQueueSemantics
class MyMessageQueue extends MessageQueue with MyMessageQueueSemantics {
def enqueue(receiver: ActorRef, handle: Envelope): Unit = ???
def dequeue(): Envelope = ???
def hasMessages(): Boolean = ???
def numberOfMessages(): Int = ???
def cleanUp(owner: ActorRef, deadLetters: MessageQueue) = ???
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment