trait Dispatcher[F[_]] extends DispatcherPlatform[F]
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.
- Source
- Dispatcher.scala
- Alphabetic
- By Inheritance
- Dispatcher
- DispatcherPlatform
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def reportFailure(t: Throwable): Unit
- Attributes
- protected
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def unsafeRunAndForget[A](fa: F[A]): Unit
Submits an effect to be executed with fire-and-forget semantics.
- def unsafeRunCancelable[A](fa: F[A]): () => Future[Unit]
Submits an effect to be executed, returning a cancelation token that can be used to cancel it.
- def unsafeRunSync[A](fa: F[A]): A
Submits an effect to be executed and indefinitely blocks until a result is produced.
Submits an effect to be executed and indefinitely blocks until a result is produced. Cancels the effect in case of Java thread interruption. This function will throw an exception if the submitted effect terminates with an error.
- Definition Classes
- DispatcherPlatform
- def unsafeRunTimed[A](fa: F[A], timeout: Duration): A
Submits an effect to be executed and blocks for at most the specified timeout for a result to be produced.
Submits an effect to be executed and blocks for at most the specified timeout for a result to be produced. Cancels the effect both in case of timeout or Java thread interruption. This function will throw an exception if the submitted effect terminates with an error.
- Definition Classes
- DispatcherPlatform
- def unsafeToCompletableFuture[A](fa: F[A]): CompletableFuture[A]
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.- Definition Classes
- DispatcherPlatform
- def unsafeToFuture[A](fa: F[A]): Future[A]
Submits an effect to be executed, returning a
Future
that holds the result of its evaluation. - final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()