IAsyncSource

interface IAsyncSource<out T> : ISource<T>

An object that allows to subscribe to events of type T and to handle them on a different thread.

Functions

Link copied to clipboard
abstract fun advise(lifetime: Lifetime, handler: (T) -> Unit)

Adds an event subscription. Every time an event occurs, the handler is called, receiving an instance of the event. The subscription is removed when the given lifetime expires.

Link copied to clipboard
abstract fun adviseOn(    lifetime: Lifetime,     scheduler: IScheduler,     handler: (T) -> Unit)

Adds an event subscription. Every time an event occurs, the handler is called on the given scheduler, receiving an instance of the event. The subscription is removed when the given lifetime expires.

Inheritors

Link copied to clipboard
Link copied to clipboard

Extensions

Link copied to clipboard
fun IAsyncSource<Unit>.adviseOn(    lifetime: Lifetime,     scheduler: IScheduler,     handler: () -> Unit)