Created
June 10, 2018 14:16
-
-
Save adamw/23853ebd6d248a4e015fc3120561ebbc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ConsumeQueueActor(connector: QueueConnector[Future]) | |
extends Actor with ActorLogging { | |
import context.dispatcher | |
private var currentQueue: Option[Queue[Future]] = None | |
override def preStart(): Unit = // ... | |
override def postStop(): Unit = { | |
log.info("[queue-stop] stopping queue actor") | |
currentQueue.foreach { queue => | |
log.info("[queue-stop] closing") | |
Await.result(queue.close(), 1.minute) | |
log.info("[queue-stop] closed") | |
} | |
} | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment