Stackable modification for actors that want to automatically confirm the
receipt of an event org.eligosource.eventsourced.core.Message from a
org.eligosource.eventsourced.core.Channel. If the modified actor's
receive method successfully returns, this trait calls confirm(true) on
the received event message. If receive throws an exception, this trait
calls confirm(false) on the received event message and re-throws the
exception. Usage example:
val myActor = system.actorOf(Props(new MyActor with Confirm))
class MyActor extends Actor {
def receive = {
case msg: Message =>// ...
}
}
val myActor = system.actorOf(Props(new MyActor with Receiver with Confirm with Eventsourced { val id = ... } ))
class MyActor extends Actor {
def receive = {
case event =>// ...
}
}
Stackable modification for actors that want to automatically confirm the receipt of an event org.eligosource.eventsourced.core.Message from a org.eligosource.eventsourced.core.Channel. If the modified actor's
receive
method successfully returns, this trait callsconfirm(true)
on the received event message. Ifreceive
throws an exception, this trait callsconfirm(false)
on the received event message and re-throws the exception. Usage example:This trait can also be used in combination with other stackable traits of the library (such as org.eligosource.eventsourced.core.Receiver, org.eligosource.eventsourced.core.Emitter or org.eligosource.eventsourced.core.Eventsourced), for example: