This is the abstract base class of all schedulers, which are used to manage the asynchronous behavior of coroutines. Refer to the hxcoro.schedulers package in the hxcoro haxelib for concrete implementations.

Static variables

@:value(new Key<Scheduler>("Scheduler"))staticfinalread onlykey:Key<Scheduler> = new Key<Scheduler>("Scheduler")

The key which is internally used to look up schedulers.

Methods

now():Int64

Returns the current time in millseconds.

schedule(ms:Int64, func:() ‑> Void):ISchedulerHandle

Schedules func to be run ms milliseconds from now. Returns an ISchedulerHandle which allows cancellation.

scheduleObject(obj:IScheduleObject):Void

Schedules obj to run. Schedulers ensure that the order of execution follows first-in-first-out.