Anticipating the usual "why not use the async module?" question, I posted a 
"pipeworks vs. async" comparison here:

https://gist.github.com/kevinswiber/5394922

The Premise:
1. Start a pipeline.
2. Delegate to workers passed into the execution context.
3. Pause until the workers are done.
4. Continue executing the pipeline.

Absolutely, the async module can handle this.

The major difference…

The async module is a toolbox of useful async utility functions.  Pipeworks use 
cases are focused on joining, splitting, and passing around execution pipelines 
as first-class citizens.  Executing a pipeline is explicit, and it's not 
uncommon to load up a pipeline and hang on to it until the right moment of 
execution.

So when would you use pipeworks over async?  When your use-case needs to 
explicitly manage execution pipelines.  My use case is an HTTP reverse proxy.  
We build a pipeline of middleware to execute on a request.  We build another 
pipeline for the response.  A target endpoint gets thrown in the middle, the 
pipelines are joined, and the whole thing gets executed on each request.  I 
wouldn't want to support that (along with custom middleware-specific pipelines) 
using just the async module.  Pipeworks is a good fit.

Cheers,

-- 
Kevin Swiber
@kevinswiber
https://github.com/kevinswiber

On Apr 15, 2013, at 5:50 PM, Kevin Swiber <[email protected]> wrote:

> Hello.
> 
> I just pushed the first version of pipeworks, a module for fitting together 
> small components (pipes) into pipelines.
> 
> With pipeworks, you can:
> Fit components into execution pipelines.
> Siphon the flow into branches during execution.
> Join multiple pipelines together.
> Have a look-see!  The repo is here: https://github.com/kevinswiber/pipeworks
> 
> Benefits:
> Reuse components (pipes).
> Redirect flow to branches on-the-fly (pipeline.siphon).
> Compose multiple pipelines prior to execution (pipeline.join).
> Ensure certain pipes are executed before or after the main execution flow 
> (pipeline.fit).
> Example:
> 
> https://github.com/kevinswiber/pipeworks#example
> 
> It works very well with a plug-in architecture that imposes an ordered, 
> asynchronous execution flow.  Pipeworks is extracted from an HTTP server 
> project, where it is currently being used as the primary engine of middleware 
> execution.  I hope it fits a use case for you, as well.
> 
> Feedback, issues, and pull requests are always welcome.
> 
> This is pretty rad, and I dig it.  I hope you do, too.
> 
> Thanks!
> 
> -- 
> Kevin Swiber
> @kevinswiber
> https://github.com/kevinswiber
> 

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

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to