When running the examples you can set the DEBUG
env variable to flow-wing*
(DEBUG=flow-wing*) in order to see a detailed log of what is going on.
Additionally you could pass the cli arguments -v
/--verbose
and delay-factor-ms
(in milliseconds) to some of the examples.
$ DEBUG=flow-wing* node examples/{example}.js {verbose-flag} {delay-factor-ms}
-
tasks.js - Shows how to create tasks, its handlers and how to pass custom task arguments.
-
flows-as-tasks.js - Shows how to make a list of flows, convert these to tasks and run them into another one.
-
piped-flows.js - Shows how to make a list of flows and pipe them together so that when the main one runs it will pipe its results to the next one and so on (it's the same as waterfall).
-
multiple-concurrent-executions.js - Demonstrates that every flow.run() has its own runtime/context data.
-
requests-flow.js - Creates two flows, one to retrieve the list of users from
https://jsonplaceholder.typicode.com
and the other one to retrieve every user's posts in parallel.
In order to run the examples you'll need to:
git clone {repo-url}/flow-wing
cd {clone-dir}/flow-wing
npm install
And then you're ready to run the examples as follow:
# Running examples
$ DEBUG=flow-wing* node examples/tasks.js
$ DEBUG=flow-wing* node examples/requests-flow.js -v
$ DEBUG=flow-wing* node examples/piped-flows.js -v 10