QueueingEventSubject

class QueueingEventSubject<E>(capacity: Int) : SynchronizedObject, EventSource<E> , Consumer<E>

An EventSource that can also consume events. If it has a subscriber, events will be immediately forwarded to that subscriber. If it doesn't have a subscriber, it will queue up events (up to the maximum capacity specified in the constructor), and forward all queued events to the next subscriber. Only a single subscription at a time is permitted.

Constructors

Link copied to clipboard
constructor(capacity: Int)

Functions

Link copied to clipboard
open override fun accept(value: E)
Link copied to clipboard
open override fun subscribe(eventConsumer: Consumer<E>): Disposable