### Table of Contents - [constructor](#constructor) - [lock](#lock) - [update](#update) - [getInstance](#getinstance) - [done](#done) - [wait](#wait) - [leastNumberOfTicks](#leastnumberofticks) ## constructor [scheduler.js:10-19](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/scheduler.js#L10-L19 "Source code on GitHub") The Scheduler manages the run cycle of Actors and figures out which order they should run in ## lock [scheduler.js:26-28](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/scheduler.js#L26-L28 "Source code on GitHub") locks the scheduler from clearing waits untill the lock is resolved **Parameters** - `id` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Returns **[function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** the resolve function to call once it to unlock ## update [scheduler.js:34-39](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/scheduler.js#L34-L39 "Source code on GitHub") updates an instance with a new tick count **Parameters** - `instance` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** an actor instance ## getInstance [scheduler.js:51-53](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/scheduler.js#L51-L53 "Source code on GitHub") returns an Actor instance **Parameters** - `id` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** ## done [scheduler.js:59-63](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/scheduler.js#L59-L63 "Source code on GitHub") deletes an instance from the scheduler **Parameters** - `id` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** the containers id ## wait [scheduler.js:72-86](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/scheduler.js#L72-L86 "Source code on GitHub") returns a promise that resolves once all containers have reached the given number of ticks **Parameters** - `ticks` **interger** the number of ticks to wait - `id` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** optional id of the container that is waiting Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** ## leastNumberOfTicks [scheduler.js:92-101](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/scheduler.js#L92-L101 "Source code on GitHub") returns the oldest container's ticks **Parameters** - `exculde` Returns **integer**