SubscriberManager[A: Any #share]¶
Manages a subscriber list.
Public Functions¶
min_request¶
Returns the lowest request count of all subscribers.
Returns¶
- U64 val
max_request¶
Returns the highest request count of all subscribers.
Returns¶
- U64 val
queue_bound¶
Returns the queue bound.
Returns¶
- U64 val
queue_size¶
Returns the current queue size.
Returns¶
- U64 val
subscriber_count¶
Returns the current subscriber count.
Returns¶
- U64 val
publish¶
A ManagedPublisher should call this when it has data to publish. Subscribers with pending demand will be sent the data immediately. If any subscribers with no pending demand exist, the data will be kept on a queue to be sent when subscribers request additional data.
The queue size can be bounded. If so, undelivered old data will be dropped if new data must be queued and the queue has hit its size limit.
Parameters¶
- a: A
Returns¶
- None val
on_complete¶
A ManagedPublisher should call this when it has no more data to produce.
Returns¶
- None val
on_error¶
A ManagedPublisher should call this when its internal state has resulted in an error that should be propagated to all subscribers.
Parameters¶
- e: ReactiveError val
Returns¶
- None val
on_subscribe¶
A ManagedPublisher should call this when it receives Publisher.subscribe.
Parameters¶
- sub: Subscriber[A] tag
Returns¶
- None val
on_request¶
A ManagedPublisher should call this when it receives ManagedPublisher._on_request.
Parameters¶
- sub: Subscriber[A] tag
- n: U64 val
Returns¶
- None val
on_cancel¶
A ManagedPublisher should call this when it receives ManagedPublisher._on_cancel.
Parameters¶
- sub: Subscriber[A] tag
Returns¶
- None val