Asynchronous Topic.
Asynchronous Topic.
Topic allows you to distribute A
published by arbitrary number of publishers to arbitrary number of subscribers.
Topic has built-in back-pressure support implemented as maximum bound (maxQueued
) that a subscriber is allowed to enqueue.
Once that bound is hit, publishing may semantically block until the lagging subscriber consumes some of its queued elements.
Additionally the subscriber has possibility to terminate whenever size of enqueued elements is over certain size
by using subscribeSize
.
- Companion
- object
Value members
Abstract methods
Publishes one A
to topic.
Publishes one A
to topic.
This waits until a
is published to all subscribers.
If any of the subscribers is over the maxQueued
limit, this will wait to complete until that subscriber processes
enough of its elements such that a
is enqueued.
Subscribes for A
values that are published to this topic.
Subscribes for A
values that are published to this topic.
Pulling on the returned stream opens a "subscription", which allows up to
maxQueued
elements to be enqueued as a result of publication.
The first element in the stream is always the last published A
at the time
the stream is first pulled from, followed by each published A
value from that
point forward.
If at any point, the queue backing the subscription has maxQueued
elements in it,
any further publications semantically block until elements are dequeued from the
subscription queue.
- Value Params
- maxQueued
maximum number of elements to enqueue to the subscription queue before blocking publishers