Accessing the EventMachine connection?
janko opened this issue · comments
Is there a way to access the EventMachine::Connection
object (that is, the Goliath::Connection
subclass) during processing of the request? I would like to set EventMachine::Connection#comm_inactivity_timeout
for each request, so that the connection automatically closes after certain amount of time in which there was no data received from the client.
https://github.com/postrank-labs/goliath/blob/master/lib/goliath/request.rb#L18 - we do expose conn
accessor on the request.
@igrigorik Thanks! Is there a way to access the Goliath::Request
object from inside a Goliath::API
? I hoped it would get stored in the env
, but I didn't find it there.
Hmm, no it doesn't look like it -- been a while since I've read through the code.. :)
I changed my mind in #341, as I will be able to use Goliath to send the response after all, so I won't be needing the access Goliath::Request
or Goliath::Connection
.
👍