Dependency based asynchronous flow

142 views
Skip to first unread message

Tom

unread,
Jan 9, 2013, 4:13:14 PM1/9/13
to nod...@googlegroups.com
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).


Any input would be greatly appreciated, as this is my first release on npm :-)

Cheers,

Tom Wieland

Mark Hahn

unread,
Jan 9, 2013, 4:16:39 PM1/9/13
to nodejs
Can it handle loops?


--
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 nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Tom

unread,
Jan 9, 2013, 4:21:52 PM1/9/13
to nod...@googlegroups.com
No, It's a Directed Acyclic Graph, but that's an interesting problem I'll look into.
Message has been deleted

Tim Caswell

unread,
Jan 9, 2013, 5:37:17 PM1/9/13
to nod...@googlegroups.com
I also tried this approach in the early days and handed off the code to tmpvar as conductor.  Personally it was too complex to be usable, but it sure was a fun challenge to write.


On Wed, Jan 9, 2013 at 4:17 PM, Tatumizer <tatu...@gmail.com> wrote:
hi Tom,
did you come up with this concept independently?
It very much reminds me where I was with this concept 1.5 years ago.
Newer version is:
https://github.com/tatumizer/circuit

Tim Caswell

unread,
Jan 9, 2013, 5:38:06 PM1/9/13
to nod...@googlegroups.com
Oops, forgot the link.  Here is the article announcing it from almost 3 years ago http://howtonode.org/step-of-conductor
Message has been deleted

Elijah Insua

unread,
Jan 9, 2013, 6:10:47 PM1/9/13
to nod...@googlegroups.com
Oh right, I'm still on the hook for making a visual editor for this thing ;)
Message has been deleted

Mark Hahn

unread,
Jan 9, 2013, 7:10:37 PM1/9/13
to nodejs
there is no such thing as a new idea.  Whenever you investigate patents the harder you look the more you can go back in time.


On Wed, Jan 9, 2013 at 4:06 PM, Tatumizer <tatu...@gmail.com> wrote:
I came up with same idea 25 years ago while writing simulations in queuing theory. There was a language back then called Ratfor (Rational Fortran) - I used it on Russian "version" of PDP-11.

I started learning javascript 2 years ago, and was surprised that this simple idea is not in mainstream.

Recently I learned that the concept of "circuit" as acyclic graph of gates is one of the well-known ideas in complexity theory (the one that deals with P vs NP and other esoteric stuff).
http://en.wikipedia.org/wiki/Circuit_complexity

Anyway, it's an old concept, I think every one will sooner or later come up with same idea given same problem.

And it's really good for simulations in queuing theory! :)

Christian Tellnes

unread,
Jan 9, 2013, 8:44:06 PM1/9/13
to nod...@googlegroups.com
My async library has quite similar functionality and syntax. The goal was to make it as short and simple as possible to use.
It has a very small API, but quite flexible.




2013/1/9 Tom <tom.w...@gmail.com>

--
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 nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en



--
Please regards Christian Vaagland Tellnes
Message has been deleted
Message has been deleted
Message has been deleted

nin jin

unread,
Jan 10, 2013, 1:00:44 AM1/10/13
to nod...@googlegroups.com
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 написал:

Christian Tellnes

unread,
Jan 10, 2013, 10:58:48 AM1/10/13
to nod...@googlegroups.com
2013/1/10 Alex Tatumizer <tatu...@gmail.com>
> it suffers from the same disease as my old version of mesh.js.
> Boilerplate, syntactic noise, no forest for the trees.
> That's what I was told about my mesh.js. I looked at it again - and saw it was true.

Thanks Alex for reviewing.

I can not see how I can change it such that I write less code. Except
for those cases where you need an extra set of parentheses at the end.
But they have a function you can send in additional parameters to the
function provied. Usefull if the function is not defined in the same
scope.

I added a couple examples for the example problems in Circuit:
https://github.com/tellnes/track.js/tree/master/examples

> We have a lively discussion on circuit issue on github. Care to join? There's only one remaining syntax issue with callbacks. The rest of boilerplate is gone.
I'll take a look at that issue and se if I have something to contribute.
Message has been deleted

Eldar

unread,
Jan 10, 2013, 11:54:08 AM1/10/13
to nod...@googlegroups.com
Wow, how many similar libs appeared simultaneously. But, hey guys to be honest, make-flow is the most javascript-ish and the only practical out there :)
Message has been deleted

Eldar

unread,
Jan 10, 2013, 1:04:56 PM1/10/13
to nod...@googlegroups.com
nope, that's wrong

On Thursday, January 10, 2013 9:28:40 PM UTC+4, Tatumizer wrote:
@eldar: sure, any honest person prefers his own lib :)

Tom

unread,
Jan 10, 2013, 4:09:01 PM1/10/13
to nod...@googlegroups.com
I don't like having my threads hijacked.

Use mine because it's better? Oh you are where I was years ago?

Too bad this isn't a forum, because I'd request a thread lock.

I'll just continue with my project, and leave the 'real' work to the 'big boys'.

I'm sure this doesn't leave a great impression of me but neither does it of the mailing list. I guess this is what happens when communities get big.

I'll move discussion of graphflow to github.


--

Eldar

unread,
Jan 10, 2013, 4:25:06 PM1/10/13
to nod...@googlegroups.com
I am sorry, I true didn't want to say "Oh, you lib is crap, I don't respect" and don't have that in mind. But you requested feedback and were pointed to other libs with similar idea. The best thing is to grap some useful ideas from them if there are such. BTW, why do you need feedback? The best feedback is your app and your users.

Mark Hahn

unread,
Jan 10, 2013, 10:26:14 PM1/10/13
to nodejs
I don't like having my threads hijacked

You must not have been following this forum for very long.  Every month or two someone posts something about an async library and then a flame war erupts.  Some threads have gone into hundreds of posts.  Someone always suggests to ban these threads or start a new forum.  This is a *very* opinionated topic.  You didn't realize what a mine field you were stepping into.  Check out some old threads.
Reply all
Reply to author
Forward
0 new messages