Skip to content

SubscriberManager[A: Any #share]

[Source]

Manages a subscriber list.

interface ref SubscriberManager[A: Any #share]

Public Functions

min_request

[Source]

Returns the lowest request count of all subscribers.

fun box min_request()
: U64 val

Returns


max_request

[Source]

Returns the highest request count of all subscribers.

fun box max_request()
: U64 val

Returns


queue_bound

[Source]

Returns the queue bound.

fun box queue_bound()
: U64 val

Returns


queue_size

[Source]

Returns the current queue size.

fun box queue_size()
: U64 val

Returns


subscriber_count

[Source]

Returns the current subscriber count.

fun box subscriber_count()
: U64 val

Returns


publish

[Source]

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.

fun ref publish(
  a: A)
: None val

Parameters

  • a: A

Returns


on_complete

[Source]

A ManagedPublisher should call this when it has no more data to produce.

fun ref on_complete()
: None val

Returns


on_error

[Source]

A ManagedPublisher should call this when its internal state has resulted in an error that should be propagated to all subscribers.

fun ref on_error(
  e: ReactiveError val)
: None val

Parameters

Returns


on_subscribe

[Source]

A ManagedPublisher should call this when it receives Publisher.subscribe.

fun ref on_subscribe(
  sub: Subscriber[A] tag)
: None val

Parameters

Returns


on_request

[Source]

A ManagedPublisher should call this when it receives ManagedPublisher._on_request.

fun ref on_request(
  sub: Subscriber[A] tag,
  n: U64 val)
: None val

Parameters

Returns


on_cancel

[Source]

A ManagedPublisher should call this when it receives ManagedPublisher._on_cancel.

fun ref on_cancel(
  sub: Subscriber[A] tag)
: None val

Parameters

Returns