Permalink
Browse files

[dist api] interface change on after filters

* now you need to provide a function that returns a stream, so
  new instances of that stream can be instantiated for each request

function MyAfterStream() {
  return function () {
    var stream   = new union.ResponseStream();

    stream.once("pipe", function (req) {
      console.log(req);
      return cb ? cb(null,req) : undefined;
    });

    return stream;
  }
}
  • Loading branch information...
dscape committed Mar 20, 2012
1 parent b9dd1db commit 7447d624ab3537ddc5c9fe77b51d8b1dd36e825e
Showing with 4 additions and 3 deletions.
  1. +3 −2 README.md
  2. +1 −1 package.json
View
@@ -91,8 +91,9 @@ Specification
for `/favicon.ico`.
@option after {Array}
- The `after` value is an array of stream filters, which are applied after the request handlers
- in `options.before`. Stream filters inherit from `union.ResponseStream`, which implements the
+ The `after` value is an array of functions that return stream filters,
+ which are applied after the request handlers in `options.before`.
+ Stream filters inherit from `union.ResponseStream`, which implements the
Node.js core streams api with a bunch of other goodies.
@option limit {Object}
View
@@ -1,7 +1,7 @@
{
"name": "union",
"description": "A hybrid buffered / streaming middleware kernel backwards compatible with connect.",
- "version": "0.1.8",
+ "version": "0.2.0",
"author": "Nodejitsu Inc. <info@nodejitsu.com>",
"contributors": [
{ "name": "Charlie Robbins", "email": "charlie.robbins@gmail.com" },

0 comments on commit 7447d62

Please sign in to comment.