schedula.js
priority based work scheduler for javascript.
- ~700 bytes minified+gzipped
Browser Support
- Edge
- IE 8+
- Chrome
- Firefox
- Safari
- Node
Installation
direct download
CDN
npm
npm install md.js --save
Examples
// create a fibervar fiber = ; // push workfiber; // slow things down, this will throttle work to a 20fps budgetschedulebudget = 20; // speed things up, this will throttle work to a 60fps budgetschedulebudget = 60; // contextvar foo = { console; } fiber; // manually flush high priority work, without throttlingfiber; // manually flush low priority work, without throttling
API
push
push work
/** * @param * @param * @param * @param * @param */
flush
manually flush work sync
/** * @param */
budget
get/set budget
/** * @type getter/setter */
work
get queued work.
/** * @type getter */