observable.observable

Provides a channel/range style observer framework.

Observables provide a similar functionality to Signal, but they are composable and provide a sequential subscriber API. Their API is also nothrow for the most part, so that the subscriber side cannot interfere with the side that emits events.

Members

Aliases

ObservableType
alias ObservableType(O) = typeof(O.Event.init.eventValue)

Extracts the event tyoe of an observable.

Classes

ObserverClosedException
class ObserverClosedException

Thrown by Observer.consumeOne in case there are no more events left.

Enums

isObservable
eponymoustemplate isObservable(O)

Determines whether a type qualifies as an observable.

Functions

delay
auto delay(O source, Duration delay)

Forwards the events emitted by an observable with a fixed delay.

map
auto map(O source)

Applies a transformation on the events emitted by an observer.

merge
auto merge(OBSERVERS observers)

Combines multiple observers into one.

subscribe
Observer!(ObservableType!O) subscribe(O observable)

Creates an observer for the specified observable.

timestamp
auto timestamp(O source)

Records the time at which each event was emitted.

Structs

Observable
struct Observable(T, EXTRA_STORAGE = void)

A basic observable.

ObservableSource
struct ObservableSource(T, EXTRA_STORAGE = void)

The fundamental source for generating observable events.

Observer
struct Observer(T)

An observer tied to a specific observable.

TimestampedEvent
struct TimestampedEvent(T)
Undocumented in source.

Templates

ObservedEvent
template ObservedEvent(T)
Undocumented in source.

Meta

Authors

Sönke Ludwig