$ iris new myApp
Creates a new folder called myApp
with the following contents:
myApp/
|___modules/
| |___docks/
| |___handlers/
| |___hooks/
|___irisfile.js
|___package.json
Then runs npm install
.
$ iris init
Creates an empty Irisfile and runs npm install gcba-iris/iris --save
.
Define data flows in the Irisfile using iris.flow()
.
iris.flow(name, config);
const iris = require('iris');
const dock = require('./docks/http');
const handler = require('./handlers/handler1');
const handler2 = require('./handlers/handler2');
const hook1 = require('./hooks/hook1');
const hook2 = require('./hooks/hook2');
iris.config = {
threads: 4,
logLevel: 'warn'
};
dock.config = {
port: 5000
};
iris.flow('Flow 1', {
tag: 'tag1',
docks: [dock],
handler: handler,
inputHooks: [hook1],
outputHooks: [hook2]
});
iris.flow('Flow 2', {
tag: 'tag2',
docks: [dock],
handler: handler2,
inputHooks: [hook2]
});
The default amount of threads is the number of CPU cores.
Inside a project directory:
$ iris