subscribe

abstract fun subscribe(eventConsumer: Consumer<E>): Disposable

Subscribes the supplied consumer to the events from this event source, until the returned Disposable is disposed. Multiple such subscriptions can be in place concurrently for a given event source, without affecting each other.

Return

a disposable used to stop the source from emitting any more events to this consumer

Parameters

eventConsumer

the consumer that should receive events from the source