Removing awaitActivation and awaitDeactivation and just retain the future-returning methods as to promote not to block.
This commit is contained in:
parent
52e4a18ebe
commit
7ba74434de
10 changed files with 179 additions and 215 deletions
|
|
@ -4,6 +4,7 @@ import akka.actor.{ Props, ActorSystem }
|
|||
import akka.camel.CamelExtension
|
||||
|
||||
import language.postfixOps
|
||||
import akka.util.Timeout
|
||||
|
||||
object Introduction {
|
||||
def foo = {
|
||||
|
|
@ -91,16 +92,12 @@ object Introduction {
|
|||
val camel = CamelExtension(system)
|
||||
val actorRef = system.actorOf(Props[MyEndpoint])
|
||||
// get a future reference to the activation of the endpoint of the Consumer Actor
|
||||
val activationFuture = camel.activationFutureFor(actorRef, 10 seconds)
|
||||
// or, block wait on the activation
|
||||
camel.awaitActivation(actorRef, 10 seconds)
|
||||
val activationFuture = camel.activationFutureFor(actorRef)(timeout = 10 seconds)
|
||||
//#CamelActivation
|
||||
//#CamelDeactivation
|
||||
system.stop(actorRef)
|
||||
// get a future reference to the deactivation of the endpoint of the Consumer Actor
|
||||
val deactivationFuture = camel.activationFutureFor(actorRef, 10 seconds)
|
||||
// or, block wait on the deactivation
|
||||
camel.awaitDeactivation(actorRef, 10 seconds)
|
||||
val deactivationFuture = camel.deactivationFutureFor(actorRef)(timeout = 10 seconds)
|
||||
//#CamelDeactivation
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue