THub

zio.stm.THub
See theTHub companion object
sealed abstract class THub[A]

A THub is a transactional message hub. Publishers can publish messages to the hub and subscribers can subscribe to take messages from the hub.

Attributes

Companion
object
Source
THub.scala
Graph
Supertypes
trait TEnqueue[A]
trait Serializable
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def publish(a: A): USTM[Boolean]

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

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

Attributes

Source
THub.scala

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

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

Attributes

Source
THub.scala

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.

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.

Attributes

Source
THub.scala

Concrete methods

final override def awaitShutdown: USTM[Unit]

Waits for the hub to be shut down.

Waits for the hub to be shut down.

Attributes

Definition Classes
Source
THub.scala
final override def isEmpty: USTM[Boolean]

Checks if the queue is empty.

Checks if the queue is empty.

Attributes

Definition Classes
Source
THub.scala
final override def isFull: USTM[Boolean]

Checks if the queue is at capacity.

Checks if the queue is at capacity.

Attributes

Definition Classes
Source
THub.scala
final def offer(a: A): USTM[Boolean]

Offers a value to the queue, returning whether the value was offered to the queue.

Offers a value to the queue, returning whether the value was offered to the queue.

Attributes

Source
THub.scala
final def offerAll(as: Iterable[A]): USTM[Boolean]

Offers all of the specified values to the queue, returning whether they were offered to the queue.

Offers all of the specified values to the queue, returning whether they were offered to the queue.

Attributes

Source
THub.scala
final def subscribeScoped(implicit trace: Trace): ZIO[Scope, Nothing, TDequeue[A]]

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.

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.

Attributes

Source
THub.scala

Inherited and Abstract methods

def capacity: Int

The maximum capacity of the queue.

The maximum capacity of the queue.

Attributes

Inherited from:
TEnqueue
Source
TEnqueue.scala

Checks whether the queue is shut down.

Checks whether the queue is shut down.

Attributes

Inherited from:
TEnqueue
Source
TEnqueue.scala

Shuts down the queue.

Shuts down the queue.

Attributes

Inherited from:
TEnqueue
Source
TEnqueue.scala
def size: USTM[Int]

The current number of values in the queue.

The current number of values in the queue.

Attributes

Inherited from:
TEnqueue
Source
TEnqueue.scala