mattstyles / koa-socket

Sugar for connecting socket.io to a koa instance
242 stars 50 forks source link

Middleware stack doesn't run unless there is at least one listener attached #4

Closed vjpr closed 9 years ago

vjpr commented 9 years ago

The middleware stack should run regardless of attached listeners - this is what I initially expected.

Or maybe just indicate at least one event needs to be attached.

mattstyles commented 9 years ago

Sorry, been on holiday, yeah, that sounds crap. I'll have a go at making things better tonight.

Cheers

mattstyles commented 9 years ago

Hi, v2 is just released, compatible with koa v2.

There is still the requirement to attach an event, the middleware is implemented with the expectation that it runs in the middle of the response chain, implying that an event listener needs to be attached as the listener forms the end-point.