Scala ExecutionContext
In this section, we will discuss the third and important component of Scala Future API–ExecutionContext
.
In simple words, ExecutionContext
is something similar to a thread pool.
What is ExecutionContext?
ExecutionContext
is a place where our Future's computation unit is executed.
The Scala language gives us a ready-made static global ExecutionContext
in scala.concurrent.ExecutionContext.global
.
In simple words, ExecutionContext
is home for both a Scala Future and a Promise to execute their tasks.