Hub

abstract class Hub[A] extends Serializable

A Hub[A] is a concurrent data structure that allows multiple publishers to publish A values and multiple subscribers to poll A values with the guarantee that all subscribers will receive all values published to the hub while they are subscribed.

Companion:
object
class Object
trait Matchable
class Any

Value members

Abstract methods

The maximum capacity of the hub.

The maximum capacity of the hub.

Checks whether the hub is currently empty.

Checks whether the hub is currently empty.

Checks whether the hub is currently full.

Checks whether the hub is currently full.

def publish(a: A): Boolean

Publishes the specified value to the hub and returns whether the value was successfully published to the hub.

Publishes the specified value to the hub and returns whether the value was successfully published to the hub.

def publishAll(as: Iterable[A]): Chunk[A]

Publishes the specified values to the hub, returning the values that could not be successfully published to the hub.

Publishes the specified values to the hub, returning the values that could not be successfully published to the hub.

def size(): Int

The current number of values in the hub.

The current number of values in the hub.

def slide(): Unit

Drops a value from the hub.

Drops a value from the hub.

Subscribes to receive values from the hub.

Subscribes to receive values from the hub.