Schedulers API
A scheduler controls how and when an observable delivers its actions: the initial subscription and each next, error, and complete event. The default scheduler for almost all observables is the AsapScheduler, which runs every action as soon as possible. The AsyncScheduler delivers messages asynchronously instead. Both are described on the Subjects page.
Interface
Every scheduler is a subtype of AbstractScheduler and implements the following interface.
Rocket.AbstractScheduler — Type
AbstractSchedulerAbstract supertype for all schedulers. A scheduler controls how and when an observable delivers its actions: the initial subscription and each next, error, and complete event. The default scheduler for almost all observables is AsapScheduler, which runs every action as soon as possible.
See also: getscheduler, scheduled_subscription!, scheduled_next!, scheduled_error!, scheduled_complete!
Rocket.getscheduler — Function
getscheduler(scheduler)Returns the scheduler instance associated with the given object. Most schedulers simply return themselves.
See also: AbstractScheduler
Rocket.scheduled_subscription! — Function
scheduled_subscription!(source, actor, instance)Performs the subscription of actor to source according to the scheduler instance. This is the entry point that a scheduler uses to control when and how a subscription happens.
See also: getscheduler, scheduled_next!, scheduled_error!, scheduled_complete!
Rocket.scheduled_next! — Function
scheduled_next!(actor, value, instance)Delivers a next event with the given value to actor according to the scheduler instance.
See also: getscheduler, scheduled_subscription!, scheduled_error!, scheduled_complete!
Rocket.scheduled_error! — Function
scheduled_error!(actor, err, instance)Delivers an error event with the given err to actor according to the scheduler instance.
See also: getscheduler, scheduled_subscription!, scheduled_next!, scheduled_complete!
Rocket.scheduled_complete! — Function
scheduled_complete!(actor, instance)Delivers a complete event to actor according to the scheduler instance.
See also: getscheduler, scheduled_subscription!, scheduled_next!, scheduled_error!
Rocket.makeinstance — Function
makeinstance(::Type{L}, scheduler)Creates a per-subscription scheduler instance for the data type L. Stateless schedulers usually return themselves, while stateful ones return a fresh instance for each subscription.
See also: instancetype, getscheduler
Rocket.instancetype — Function
instancetype(::Type{L}, ::Type{S})Returns the type of the scheduler instance produced by makeinstance for the data type L and the scheduler type S.
See also: makeinstance, getscheduler
Threads scheduler
Rocket.ThreadsScheduler — Type
ThreadsSchedulerThreadsScheduler executes scheduled actions on a separate thread.
ThreadsScheduler is experimental. Its behavior and API may change or be removed in a future release.
See also: getscheduler, scheduled_subscription!, scheduled_next!, scheduled_error!, scheduled_complete!