I have a scala file that has this import
import scala.concurrent.ExecutionContext.Implicits.global
This works fine as the Future
I am using works fine in my methods in that file. However, I have created a separate method that will be used for disk IO and I have a new execution context. I want this method to use this context while other methods can continue to use the default context. How do I guarantee that? I currently do this as follows
private def testContext():Future[Int] = {
val system = ActorSystem.create()
implicit val myexecutionContext = system.dispatchers.lookup("blocking-io-dispatcher.db-backup-context")
Future{logger.error("inside my new thread pool wonderland");10}{myexecutionContext}
Is there a way without specifying the "myexecutionContext" like this at the end of each Future call, I can make this method still use "myexecutionContext" for all Future calls? In short, I do not want to be specifying "myexecutionContext" again and again as a parameter inside my "testContext" method. How do I do that?