postrank-labs / goliath

Goliath is a non-blocking Ruby web server framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Post-response hook (for use in OOBGC)

findchris opened this issue · comments

Hi there.

I'm looking to use gctools OOBGC with Goliath, and wondered if there is a hook for after the HTTP response is sent to the client. This would be an ideal time for triggering OOBGC.

Cheers.

Hmm, we support streaming responses, so there isn't one clear hook. That said, take a look at the response class - e.g. https://github.com/postrank-labs/goliath/blob/master/lib/goliath/response.rb#L73

Thanks @igrigorik. Looks like handling the close event of the body is the way to go. Thanks for the quick response!