-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontrolflow.js
78 lines (65 loc) · 1.61 KB
/
controlflow.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/**
* Module to handle the control flow of a node application.
* It is mainly a wrapper for the control flow functions of async module.
*
* @module control-flow
* @requires async
*/
// dependencies
var Series = require("./libs/Series.js");
var Waterfall = require("./libs/Waterfall.js");
var Parallel = require("./libs/Parallel.js");
/**
* Initialize module
*/
/**
* The control flow object that lets create the several kinds of control flow tasks.
*
* @class ControlFlow
*/
function ControlFlow () {
/**
* Returns a series task object.
*
* @method createSeries
* @return {Series} The object that generates a waterfall series flow task
*/
this.createSeries = function () {
// create a new series task
return new Series();
};
/**
* Returns a waterfall task object.
*
* @method createWaterfall
* @return {Waterfall} The object that generates a waterfall control flow task
*/
this.createWaterfall = function () {
// create a new waterfall task
return new Waterfall();
};
/**
* Creates a parallel task object.
*
* @method createParallel
* @return {Parallel} The object that generates a parallel control flow task
*/
this.createParallel = function () {
// create a new parallel task
return new Parallel();
};
}
// export the module
module.exports = ControlFlow;
/**
* Environment
*/
module.exports.env = process.env.NODE_ENV || 'dev';
/**
* Module name.
*/
module.exports.fullname = "RwControlFlow";
/**
* Module version.
*/
module.exports.version = '0.0.1';