- 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
Callback after an observer is unsubscribed
Callback when new observer is subscribing
List the active subscriptions
Unsubscribe all subscriptions
Subscribe an observer actor to this this observables data stream
Unsubscribe a current subscription
Does this observer have any active subscriptions
Return the name of this observable
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