flatiron/union

Using after filters

robinvdvleuten opened this issue · 2 comments

I have the following code which I think is needed for using after streams.

this.http.server = union.createServer({
    before: [
        function (req, res) {
            var found = self.http.router.dispatch(req, res);
            if (!found) {
                res.emit('next');
            }
        }
    ],
    after: [
        new union.ResponseStream()
    ]
});

But when I start this application, I get the following error:
warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.

Can you please provide a better/any example for using after streams?