require( 'jin' )( function( $ ){
//var flow= require('graphflow').flow
//flow()
var forty= $.jin.sync( function( done ){
done( null, 40 )
} )
// .add('forty', function(callback) {
// callback(null, 40);
// })
var two= $.jin.sync( function( done ){
done( null, 2 )
} )
// .add('two', function(callback) {
// callback(null, 2);
// })
var result= forty() + two()
// .add('added', ['forty', 'two'], function(callback) {
// callback(null, this.forty + this.two);
// })
// .fail(function(error) {
// throw error;
// })
console.log( 'answer:', result )
// .done(function(values) {
// console.log('answer:', values.added);
// })
} )
// .run();
and you can use loops, conditions, error handling, recursion and all of
javascript stuff
четверг, 10 января 2013 г., 1:13:14 UTC+4 пользователь Tom Wieland написал:
> Hi everyone,
>
> I've created a simple library for asynchronous flow, based on specifying
> dependencies. I implemented it using a dependency graph and LiveScript.
> Except that it doesn't form one list of dependencies in order, it forms a
> list of beginning and exit nodes, and executes everything in between
> in parallel where needed by defining dependencies.
>
> I'm aiming to cut away as much code as possible by the use of .flow(), but
> also allow you to use the Graph and Node classes/functions when needing
> more expressiveness (e.g. reuse of nodes in different graphs, generating
> graphs, etc).
>
> https://github.com/Industrial/graphflow
>
> Any input would be greatly appreciated, as this is my first release on npm
> :-)
>
> Cheers,
>
> Tom Wieland
>
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en