Evaluates fa
on the supplied execution context and shifts evaluation
back to the default execution environment of F
at the completion of fa
,
regardless of success or failure.
Evaluates fa
on the supplied execution context and shifts evaluation
back to the default execution environment of F
at the completion of fa
,
regardless of success or failure.
The primary use case for this method is executing code on a
specific execution context. To execute blocking code, consider using
the blockOn(blocker)
method instead.
Execution context where the evaluation has to be scheduled
Computation to evaluate using ec
Asynchronous boundary described as an effectful F[_]
that
can be used in flatMap
chains to "shift" the continuation
of the run-loop to another thread or call stack.
Asynchronous boundary described as an effectful F[_]
that
can be used in flatMap
chains to "shift" the continuation
of the run-loop to another thread or call stack.
This is the Async.shift operation, without the need for an
ExecutionContext
taken as a parameter.
Evaluates fa
on the supplied blocker and shifts evaluation
back to the default execution environment of F
at the completion of fa
,
regardless of success or failure.
Evaluates fa
on the supplied blocker and shifts evaluation
back to the default execution environment of F
at the completion of fa
,
regardless of success or failure.
The primary use case for this method is executing blocking code on a dedicated execution context.
blocker where the evaluation has to be scheduled
Computation to evaluate using blocker
ContextShift provides support for shifting execution.
The
shift
method inserts an asynchronous boundary, which moves execution from the calling thread to the default execution environment ofF
.The
evalOn
method provides a way to evaluate a task on a specific execution context, shifting back to the default execution context after the task completes.This is NOT a type class, as it does not have the coherence requirement.