Send a message enclosed in a message envelope containing meta date about the message.
Send a message enclosed in a message envelope containing meta date about the message.
Forward a message enclosed in a message envelope containg meta data about the message.
This implementation is ported from Derek Wyatt's blog post Parts of this blog post are adapted here for documentation.
EnvelopeSending is an implicit value type class that extends the functionality of the ActorRef to provide the hook that wrap messages inside a rich envelope containg meta data about the message.
With this implicit class in scope,
send(..)
a message to an ActorRef will result in wrapping the message in an Envelope.send
orsendForward
must be used rather than the regular ActorRef'stell
,forward
, and!
methods, which will remain unwrapped with an envelope. It is easy to "drop" the envelope as a result, so as long as the envelope is important care should be taken to use the enveloping methods.