compulsive
Time based event loop process queue
Getting Started
Install the module with: npm install compulsive
Documentation
compulsive.wait( ms, callback )
Wait ms
, execute callback
.
compulsive.loop( ms, callback )
Loop ms
, execute callback
.
compulsive.repeat( count, ms, callback )
Repeat count
times, every ms
, execute callback
.
compulsive.queue( list )
Queue tasks.
// list wait: ms {} ...
Examples
var compulsive = ; compulsive; compulsive; compulsive; compulsive;
Add compulsive api to your constructor's prototype:
var compulsive = priv = "es6-collections"; { //... various nodebot constructor tasks thisservos = right: 9 left: 10 ; priv;} // Exposure grants the end dev control// over stepping positions (0-180˚)NodebotSTEPS = // Step: [ R, L ] right: right: 120 left: 60 left: right: 60 left: 120 ; // Augment the Nodebot prototype// with compulsive APIs "wait" "loop" "queue" ; Nodebotprototype { var p next last degrees; p = priv; last = pstep; next = last === "right" ? "left" : "right"; degrees = NodebotSTEPS next ; Object;}; Nodebotprototype { this;}; moduleexports = Nodebot;
var Nodebot = bot = ; bot;
Contributing
All contributions must adhere to the the Idiomatic.js Style Guide, by maintaining the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.
License
Copyright (c) 2012 Rick Waldron waldron.rick@gmail.com Licensed under the MIT license.