Blocker

final class Blocker extends AnyVal

An execution context that is safe to use for blocking operations.

An execution context that is safe to use for blocking operations.

Used in conjunction with ContextShift, this type allows us to write functions that require a special ExecutionContext for evaluation, while discouraging the use of a shared, general purpose pool (e.g. the global context).

Instances of this class should NOT be passed implicitly because they hold state and in some cases your application may need different instances of Blocker.

Companion
object
class AnyVal
trait Matchable
class Any

Value members

Concrete methods

def blockOn[F[_], A](fa: F[A])(cs: ContextShift[F]): F[A]

Evaluates the supplied task on the blocking execution context via blockOn.

Evaluates the supplied task on the blocking execution context via blockOn.

def blockOnK[F[_]](cs: ContextShift[F]): FunctionK[F, F]

blockOn as a natural transformation.

blockOn as a natural transformation.

def delay[F[_], A](thunk: => A)(F: Sync[F], cs: ContextShift[F]): F[A]

Like Sync#delay but the supplied thunk is evaluated on the blocking execution context.

Like Sync#delay but the supplied thunk is evaluated on the blocking execution context.

Concrete fields

val blockingContext: ExecutionContext