Packages

sealed abstract class ZTHub[-RA, -RB, +EA, +EB, -A, +B] extends Serializable

A ZTHub[RA, RB, EA, EB, A, B] is a transactional message hub. Publishers can publish messages of type A to the hub and subscribers can subscribe to take messages of type B from the hub. Publishing messages can require an environment of type RA and fail with an error of type EA. Taking messages can require an environment of type RB and fail with an error of type EB.

Self Type
ZTHub[RA, RB, EA, EB, A, B]
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ZTHub
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def capacity: Int

    The maximum capacity of the hub.

  2. abstract def isShutdown: USTM[Boolean]

    Checks whether the hub is shut down.

  3. abstract def publish(a: A): ZSTM[RA, EA, Boolean]

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

  4. abstract def publishAll(as: Iterable[A]): ZSTM[RA, EA, Boolean]

    Publishes all of the specified messages to the hub, returning whether they were published to the hub.

  5. abstract def shutdown: USTM[Unit]

    Shuts down the hub.

  6. abstract def size: USTM[Int]

    The current number of messages in the hub.

  7. abstract def subscribe: USTM[ZTDequeue[RB, EB, B]]

    Subscribes to receive messages from the hub.

    Subscribes to receive messages from the hub. The resulting subscription can be evaluated multiple times to take a message from the hub each time. The caller is responsible for unsubscribing from the hub by shutting down the queue.

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. final def awaitShutdown: USTM[Unit]

    Waits for the hub to be shut down.

  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  7. final def contramap[C](f: (C) ⇒ A): ZTHub[RA, RB, EA, EB, C, B]

    Transforms messages published to the hub using the specified function.

  8. final def contramapSTM[RC <: RA, EC >: EA, C](f: (C) ⇒ ZSTM[RC, EC, A]): ZTHub[RC, RB, EC, EB, C, B]

    Transforms messages published to the hub using the specified transactional function.

  9. final def dimap[C, D](f: (C) ⇒ A, g: (B) ⇒ D): ZTHub[RA, RB, EA, EB, C, D]

    Transforms messages published to and taken from the hub using the specified functions.

  10. final def dimapSTM[RC <: RA, RD <: RB, EC >: EA, ED >: EB, C, D](f: (C) ⇒ ZSTM[RC, EC, A], g: (B) ⇒ ZSTM[RD, ED, D]): ZTHub[RC, RD, EC, ED, C, D]

    Transforms messages published to and taken from the hub using the specified transactional functions.

  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  13. final def filterInput[A1 <: A](f: (A1) ⇒ Boolean): ZTHub[RA, RB, EA, EB, A1, B]

    Filters messages published to the hub using the specified function.

  14. final def filterInputSTM[RA1 <: RA, EA1 >: EA, A1 <: A](f: (A1) ⇒ ZSTM[RA1, EA1, Boolean]): ZTHub[RA1, RB, EA1, EB, A1, B]

    Filters messages published to the hub using the specified transactional function.

  15. final def filterOutput(f: (B) ⇒ Boolean): ZTHub[RA, RB, EA, EB, A, B]

    Filters messages taken from the hub using the specified function.

  16. final def filterOutputSTM[RB1 <: RB, EB1 >: EB](f: (B) ⇒ ZSTM[RB1, EB1, Boolean]): ZTHub[RA, RB1, EA, EB1, A, B]

    Filters messages taken from the hub using the specified transactional function.

  17. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  19. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  20. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  21. final def map[C](f: (B) ⇒ C): ZTHub[RA, RB, EA, EB, A, C]

    Transforms messages taken from the hub using the specified function.

  22. final def mapSTM[RC <: RB, EC >: EB, C](f: (B) ⇒ ZSTM[RC, EC, C]): ZTHub[RA, RC, EA, EC, A, C]

    Transforms messages taken from the hub using the specified transactional function.

  23. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  24. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  25. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  26. final def subscribeScoped(implicit trace: ZTraceElement): ZIO[Scope, Nothing, ZTDequeue[RB, EB, B]]

    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.

  27. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  28. def toString(): String
    Definition Classes
    AnyRef → Any
  29. final def toTQueue: ZTEnqueue[RA, EA, A]

    Views the hub as a transactional queue that can only be written to.

  30. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped