Skip to content

Instantly share code, notes, and snippets.

@dkomanov
Created May 25, 2020 16:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dkomanov/e274433891485a1916b27eab36b75e03 to your computer and use it in GitHub Desktop.
Save dkomanov/e274433891485a1916b27eab36b75e03 to your computer and use it in GitHub Desktop.
[writing-async-app-in-scala-part-3] rpc client with 2 ExecutionContexts
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