celluloid / reel

UNMAINTAINED: See celluloid/celluloid#779 - Celluloid::IO-powered web server
https://celluloid.io
MIT License
596 stars 87 forks source link

Separate Requests from WebSockets #77

Closed tarcieri closed 11 years ago

tarcieri commented 11 years ago

This API has you first obtain a Reel::Request for a given connection, which may be a WebSocket and may be potentially upgradable.

Where the old API went something like:

while request = connection.request
  case request
  when Reel::Request
    ...
  when Reel::WebSocket
    ...
  end
end

The new API works something like:

while request = connection.request
  if request.websocket?
    websocket = request.websocket
    ...
    break
  else
    ...
  end
end
coveralls commented 11 years ago

Coverage Status

Coverage increased (+0%) when pulling ca67445d2d739f5a8d8b55fd958c972a2e14526a on separate-requests-and-websockets into 2fe49472228062bb5aed888e6dc53a69e4487c8e on master.

coveralls commented 11 years ago

Coverage Status

Coverage increased (+0%) when pulling 147e49fd0a0362154074a8a1a802da409534fece on separate-requests-and-websockets into 2fe49472228062bb5aed888e6dc53a69e4487c8e on master.

tarcieri commented 11 years ago

Can we defer the connection.each_request API to a separate issue? (#79) This PR actually doesn't change anything in that regard.

Does this otherwise look good to you?

halorgium commented 11 years ago

@tarcieri yer, works for me.

tarcieri commented 11 years ago

sgb