taskflows

1.0.0 • Public • Published

TaskFlows

Scalable Promise / semaphore manager & task sequencer

Minimal Examples

As simple semaphore

        var s = new taskflow().then(callback);
        rows.forEach(function ( row ) {
                    s.wait();
                    doSomething(row, s.release);
                });
        s.run();

As task flow

        var scope = {rows : []},
            flow  = new taskflow(
                [
                    ( scope, flow )=> {
                        return [async1, async2, async3]
                    },
                    ( scope, flow )=> {

                        scope.rows.forEach(function ( row ) {
                            flow.wait();
                            doSomething(row, flow.release);
                        });

                    }
                ],
                scope
            ).then(callback).run();

Readme

Keywords

none

Package Sidebar

Install

npm i taskflows

Weekly Downloads

1

Version

1.0.0

License

none

Last publish

Collaborators

  • kameha