Hi people!

Alex: very interesting idea.

I was exploring Go language channels, futures, promises, and I implemented
some form of channels in other language. I tried to implement Storm project
in Node.js, too, I need to define distributed topologies.

Now, reading your syntax, I just wrote my module:

https://github.com/ajlopez/SimplePipes

As I read today in this thread, you can use strings insteadn of
this.property, to define your communication variables. In my
implementation, I don't need the use of an arrow, the name of the pipe
is enough.

English is not my mother tongue, so I can't explain in a clear way all the
ideas I want to implement with this module. The main differences with your
ideas:

- The variables to use to communicate functions are named "pipes".
- The pipe can be reused: that is, a system of pipes can run for ever,
receiving input message and processing them.
- The values received in a pipe, are given to the associated function as
arguments, you don't need to refer the pipe object to get a value.

Quick sample:

var flow = simplepipes.createFlow(
    "pipe1",
    function (val) {
        console.log(val);
        this.pipe2.send(val + 1);
    },
    "pipe2",
    function (val) {
        console.log(val);
        test.done();
    }
);

flow.start();
flow.pipe1.send(1);


I planned to add:

flow1.pipe1.pipe(flow2.pipe3); to chain pipes

A pipe could send the message to more than a pipe, and you can define the
strategy to use: send the message to all output pipes, or to one choose at
random, or one using round-robin, etc...

And I want  to have a distributed pipe: the message entering a pipe, is
received by other pipe in another machine. I wrote similar examples using
other of my modules, so I thing it could be added with ease.

I think I could re implement pipes using streams, but I should learn about
stopping an stream when the pipe is not consumed.

Thanks for kicking so many ideas!

Angel "Java" Lopez
@ajlopez

On Thu, Dec 27, 2012 at 10:03 PM, Alex ("Tatumizer") <[email protected]>wrote:

> I'm trying to come up with a better concept for asynchronous programming.
> My first library (mesh.js) was an attempt to use a promising line of
> attack, but it introduced a lot of boilerplate, which no one liked (myself
> included)..
>
> After a lot of head-scratching, I found the way to eliminate all
> boilerplate and syntactic noise, and eventually came up with completely new
> design -much simpler one, and much more powerful: just two functions and
> their combinations do the job in most practical cases. I renamed the
> concept to "circuit" - it's a better name for this device.
>
> https://github.com/tatumizer/**circuit/blob/master/README.md<https://github.com/tatumizer/circuit/blob/master/README.md>
>
> At this stage, it's a design doc only, specifically targeting nodejs. I
> think the concept of circuit could simplify nodejs programming..
> What is equally important that it uses all existing nodejs conventions and
> interfaces AS IS: no code generation, no wrappers, no conversions of f(x,y)
> into fubar(f,x,y) or anything - just pure nodejs code.
>
> I would be very interested to know opinions (even negative opinions) to
> improve design and find  potential flaws.
>
> Thanks,
> Alex
>
> --
> 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
>

-- 
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

Reply via email to