A keyword to receive next message of an Akka actor.
Installation
This ReceiveMessage keyword supports !-notation,
which requires BangNotation and ResetEverywhere compiler plugins along with this receivemessage library.
For sbt, add the following settings to your build.sbt:
This ReceiveMessage keyword can be used in the akka.actor.Actor.Receive domain,
to receive the next message.
The above code creates an actor to echo any messages.
import akka.actor._
def echoActor = new Actor {
def receive: Receive = {
while (true) {
val lastMessage = !ReceiveMessage[Any]
sender() ! lastMessage
}
thrownew Exception("Unreachable code!")
}
}
val pinger = system.actorOf(Props(echoActor))
pinger ! "hello world"
expectMsg("hello world")
This member is added by an implicit conversion from ReceiveMessage[Message] to
any2stringadd[ReceiveMessage[Message]] performed by method any2stringadd in scala.Predef.
This member is added by an implicit conversion from ReceiveMessage[Message] to
ArrowAssoc[ReceiveMessage[Message]] performed by method ArrowAssoc in scala.Predef.
This member is added by an implicit conversion from ReceiveMessage[Message] to
Ensuring[ReceiveMessage[Message]] performed by method Ensuring in scala.Predef.
This member is added by an implicit conversion from ReceiveMessage[Message] to
Ensuring[ReceiveMessage[Message]] performed by method Ensuring in scala.Predef.
This member is added by an implicit conversion from ReceiveMessage[Message] to
Ensuring[ReceiveMessage[Message]] performed by method Ensuring in scala.Predef.
This member is added by an implicit conversion from ReceiveMessage[Message] to
Ensuring[ReceiveMessage[Message]] performed by method Ensuring in scala.Predef.
This member is added by an implicit conversion from ReceiveMessage[Message] to
StringFormat[ReceiveMessage[Message]] performed by method StringFormat in scala.Predef.
This member is added by an implicit conversion from ReceiveMessage[Message] to
ArrowAssoc[ReceiveMessage[Message]] performed by method ArrowAssoc in scala.Predef.
A keyword to receive next message of an Akka actor.
Installation
This ReceiveMessage keyword supports !-notation, which requires BangNotation and ResetEverywhere compiler plugins along with this
receivemessage
library. For sbt, add the following settings to yourbuild.sbt
:Author:
杨博 (Yang Bo)
The type of message being received, which must be Any for akka.actor.Actor, and must be the same type of
T
for akka.actor.typed.Behavior.This ReceiveMessage keyword can be used in the akka.actor.Actor.Receive domain, to receive the next message. The above code creates an actor to echo any messages.
domains.akka.actor.typed.typedReceiveMessageDsl for usage in the typed actor domains.