Created
May 25, 2020 16:44
-
-
Save dkomanov/e274433891485a1916b27eab36b75e03 to your computer and use it in GitHub Desktop.
[writing-async-app-in-scala-part-3] rpc client with 2 ExecutionContexts
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
class RpcClient(ownEc: ExecutionContext, appEc: ExecutionContext) { | |
def call: Future[String] = | |
Future("a")(ownEc) | |
.map(identity)(appEc) // here we move back to an application execution context | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment