- Index
- »
- fan.obs
- »
- Observable
Observable
const abstract class Observable : Obj
Observable is the subject of an asynchronous data stream.
NOTE: this API is subject to change
Does this observer have any active subscriptions
Return the name of this observable
Callback when new observer is subscribing
Callback after an observer is unsubscribed
Subscribe an observer actor to this this observables data stream
List the active subscriptions
Unsubscribe a current subscription
Unsubscribe all subscriptions
Bool hasSubscriptions()
Does this observer have any active subscriptions
abstract Str name()
Return the name of this observable.
This name must match up with the the observe def subtype name
virtual Subscription onSubscribe(Observer observer, Dict config)
Callback when new observer is subscribing. Subclasses can check the config and return their own subscription subclass. This callback can be from any thread, so must be thread safe.
virtual Void onUnsubscribe(Subscription s)
Callback after an observer is unsubscribed. This callback can be from any thread, so must be thread safe.
Subscription subscribe(Observer observer, Dict config)
Subscribe an observer actor to this this observables data stream
Subscription[] subscriptions()
List the active subscriptions
Void unsubscribe(Subscription s)
Unsubscribe a current subscription
Void unsubscribeAll()
Unsubscribe all subscriptions