Class/Object

zio

Hub

Related Docs: object Hub | package zio

Permalink

abstract class Hub[A] extends Enqueue[A]

A Hub is an asynchronous message hub. Publishers can offer messages to the hub and subscribers can subscribe to take messages from the hub.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Hub
  2. Enqueue
  3. Serializable
  4. Serializable
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Hub()

    Permalink

Abstract Value Members

  1. abstract def awaitShutdown(implicit trace: Trace): UIO[Unit]

    Permalink

    Waits until the queue is shutdown.

    Waits until the queue is shutdown. The IO returned by this method will not resume until the queue has been shutdown. If the queue is already shutdown, the IO will resume right away.

    Definition Classes
    Enqueue
  2. abstract def capacity: Int

    Permalink

    How many elements can hold in the queue

    How many elements can hold in the queue

    Definition Classes
    Enqueue
  3. abstract def isShutdown(implicit trace: Trace): UIO[Boolean]

    Permalink

    true if shutdown has been called.

    true if shutdown has been called.

    Definition Classes
    Enqueue
  4. abstract def publish(a: A)(implicit trace: Trace): UIO[Boolean]

    Permalink

    Publishes a message to the hub, returning whether the message was published to the hub.

  5. abstract def publishAll[A1 <: A](as: Iterable[A1])(implicit trace: Trace): UIO[Chunk[A1]]

    Permalink

    Publishes all of the specified messages to the hub, returning any messages that were not published to the hub.

  6. abstract def shutdown(implicit trace: Trace): UIO[Unit]

    Permalink

    Interrupts any fibers that are suspended on offer or take.

    Interrupts any fibers that are suspended on offer or take. Future calls to offer* and take* will be interrupted immediately.

    Definition Classes
    Enqueue
  7. abstract def size(implicit trace: Trace): UIO[Int]

    Permalink

    Retrieves the size of the queue.

    Retrieves the size of the queue. This may be negative if fibers are suspended waiting for elements to be added to the queue or greater than the capacity if fibers are suspended waiting to add elements to the queue.

    Definition Classes
    Enqueue
  8. abstract def subscribe(implicit trace: Trace): ZIO[Scope, Nothing, Dequeue[A]]

    Permalink

    Subscribes to receive messages from the hub.

    Subscribes to receive messages from the hub. The resulting subscription can be evaluated multiple times within the scope to take a message from the hub each time.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  10. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  11. final def isEmpty(implicit trace: Trace): UIO[Boolean]

    Permalink

    Checks whether the queue is currently empty.

    Checks whether the queue is currently empty.

    Definition Classes
    HubEnqueue
  12. final def isFull(implicit trace: Trace): UIO[Boolean]

    Permalink

    Checks whether the queue is currently full.

    Checks whether the queue is currently full.

    Definition Classes
    HubEnqueue
  13. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  15. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  16. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. final def offer(a: A)(implicit trace: Trace): UIO[Boolean]

    Permalink

    Places one value in the queue.

    Places one value in the queue.

    Definition Classes
    HubEnqueue
  18. final def offerAll[A1 <: A](as: Iterable[A1])(implicit trace: Trace): UIO[Chunk[A1]]

    Permalink

    For Bounded Queue: uses the BackPressure Strategy, places the values in the queue and always returns no leftovers.

    For Bounded Queue: uses the BackPressure Strategy, places the values in the queue and always returns no leftovers. If the queue has reached capacity, then the fiber performing the offerAll will be suspended until there is room in the queue.

    For Unbounded Queue: Places all values in the queue and returns no leftovers.

    For Sliding Queue: uses Sliding Strategy If there is room in the queue, it places the values otherwise it removes the old elements and enqueues the new ones. Always returns no leftovers.

    For Dropping Queue: uses Dropping Strategy, It places the values in the queue but if there is no room it will not enqueue them and return the leftovers.

    Definition Classes
    HubEnqueue
  19. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  20. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  21. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Enqueue[A]

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped