postrank-labs / goliath

Goliath is a non-blocking Ruby web server framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

@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.