A fiber-based supervisor utility for evaluating effects across an impure boundary. This is
useful when working with reactive interfaces that produce potentially many values (as opposed
to one), and for each value, some effect in F
must be performed (like inserting each value
into a queue).
Dispatcher is a kind of Supervisor and accordingly follows the same scoping and lifecycle rules with respect to submitted effects.
Performance note: all clients of a single Dispatcher instance will contend with each other when submitting effects. However, Dispatcher instances are cheap to create and have minimal overhead, so they can be allocated on-demand if necessary.
Notably, Dispatcher replaces Effect and ConcurrentEffect from Cats Effect 2 while only requiring an cats.effect.kernel.Async constraint.
- Companion:
- object
- Source:
- Dispatcher.scala
Value members
Abstract methods
Submits an effect to be executed, returning a Future
that holds the result of its
evaluation, along with a cancelation token that can be used to cancel the original effect.
Submits an effect to be executed, returning a Future
that holds the result of its
evaluation, along with a cancelation token that can be used to cancel the original effect.
- Source:
- Dispatcher.scala
Concrete methods
Submits an effect to be executed with fire-and-forget semantics.
Submits an effect to be executed with fire-and-forget semantics.
- Source:
- Dispatcher.scala
Submits an effect to be executed, returning a cancelation token that can be used to cancel it.
Submits an effect to be executed, returning a cancelation token that can be used to cancel it.
- Source:
- Dispatcher.scala
Submits an effect to be executed, returning a Future
that holds the result of its
evaluation.
Submits an effect to be executed, returning a Future
that holds the result of its
evaluation.
- Source:
- Dispatcher.scala
Inherited methods
Submits an effect to be executed and indefinitely blocks until a result is produced. This function will throw an exception if the submitted effect terminates with an error.
Submits an effect to be executed and indefinitely blocks until a result is produced. This function will throw an exception if the submitted effect terminates with an error.
- Inherited from:
- DispatcherPlatform (hidden)
- Source:
- DispatcherPlatform.scala
Submits an effect to be executed and blocks for at most the specified timeout for a result to be produced. This function will throw an exception if the submitted effect terminates with an error.
Submits an effect to be executed and blocks for at most the specified timeout for a result to be produced. This function will throw an exception if the submitted effect terminates with an error.
- Inherited from:
- DispatcherPlatform (hidden)
- Source:
- DispatcherPlatform.scala
Submits an effect to be executed, returning a CompletableFuture
that holds the result of
its evaluation.
Submits an effect to be executed, returning a CompletableFuture
that holds the result of
its evaluation.
- Inherited from:
- DispatcherPlatform (hidden)
- Source:
- DispatcherPlatform.scala