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
Linear Supertypes
DispatcherPlatform[F], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Dispatcher
  2. DispatcherPlatform
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def unsafeToFutureCancelable[A](fa: F[A]): (Future[A], () => Future[Unit])

    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.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  9. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. def reportFailure(t: Throwable): Unit
    Attributes
    protected
  16. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  17. def toString(): String
    Definition Classes
    AnyRef → Any
  18. def unsafeRunAndForget[A](fa: F[A]): Unit

    Submits an effect to be executed with fire-and-forget semantics.

  19. 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.

  20. 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
  21. 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
  22. 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
  23. def unsafeToFuture[A](fa: F[A]): Future[A]

    Submits an effect to be executed, returning a Future that holds the result of its evaluation.

  24. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  25. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  26. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from DispatcherPlatform[F]

Inherited from AnyRef

Inherited from Any

Ungrouped