Last active
April 8, 2019 17:29
-
-
Save LimorStotland/cb7dd8f495444a34607c10732b28250e to your computer and use it in GitHub Desktop.
SuicideActor - with NPE
This file contains 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
trait SuicideActor extends Actor { | |
implicit val ec: ExecutionContext | |
def killSwitch(block: => Unit): Unit = Future({ | |
block | |
context stop self | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment