package
Execute async code in chronological order. The sequence module of FuturesJS (Browser, Node.js, Bower, and Pakmanager)
npm install sequenceGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Creates an Asynchronous Stack which execute each enqueued method after the previous function calls the provided next(err, data [, ...]).
In many cases forEachAsync or forAllAsync will be a better alternative.
Sequence.create(defaultContext=null)then(function callback(next, err, data [, ...]) {}, context) - add a callback onto the queue
Node.JS (Server):
npm install sequenceYou can install from bower:
bower install sequenceOr download the raw file from https://raw.github.com/FuturesJS/sequence/master/sequence.js:
wget https://raw.github.com/FuturesJS/sequence/master/sequence.jsOr build with pakmanager:
pakmanager build sequence(function (exports) {
'use strict';
var Sequence = exports.Sequence || require('sequence').Sequence
, sequence = Sequence.create()
, err
;
sequence
.then(function (next) {
setTimeout(function () {
next(err, "Hi", "World!");
}, 120);
})
.then(function (next, err, a, b) {
setTimeout(function () {
next(err, "Hello"