Async Queue
Manages methods that need to be run in sequence and at a particular rate. It will never return perfect values, because computation takes time, but it should be pretty close.
Example
var asyncQueue = ; var newUnit = 'adsf';var startTime = ; newUnit;newUnit; { thisid = id; thisactionQueue = ; thismove = ; thisbuild = ;}
Usage
var asyncQueue = ;
asyncQueue(actionMethod, costMethod)
actionMethod
is the function to be called.
costMethod
is a function that returns how long to wait before calling actionMethod
.
Installation
npm install habitants-async-queue
Tests
npm test