postrank-labs/goliath

Post-response hook (for use in OOBGC)

findchris opened this issue · 2 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!