A Hub
is an asynchronous message hub. Publishers can offer messages to the hub and subscribers can subscribe to take messages from the hub.
Attributes
- Companion
- object
- Graph
-
- Supertypes
Members list
Value members
Abstract methods
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
Publishes all of the specified messages to the hub, returning any messages that were not published to the hub.
Publishes all of the specified messages to the hub, returning any messages that were not published to the hub.
Attributes
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
Concrete methods
Checks whether the queue is currently empty.
Checks whether the queue is currently full.
Places one value in the queue.
Places one value in the queue.
Attributes
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 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.
Attributes
Inherited methods
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.
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.
Attributes
- Inherited from:
- Enqueue
How many elements can hold in the queue
true
if shutdown
has been called.
Interrupts any fibers that are suspended on offer
or take
. Future calls to offer*
and take*
will be interrupted immediately.
Interrupts any fibers that are suspended on offer
or take
. Future calls to offer*
and take*
will be interrupted immediately.
Attributes
- Inherited from:
- Enqueue
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.
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.
Attributes
- Inherited from:
- Enqueue