Using rack.hijack with ActionController::Live

Pinging @tenderlove

Some questions on how best to move forward with this:

1.) AC::Live is making use of the stream object on
ActionDispatch::Response. Should the rack.hijack_io object be used instead
of this in AC::Live or should ActionDispatch::Response be changed to use
rack.hijack_io?

The non-buffering stream object should be implemented in terms of
hijack. IIRC, AC::Live is the one that provides a `stream` method that
actually does anything. The default `stream` just returns a buffer.

2.) What do you think about changing AC::Live to work with adapters? I
suspect the primary use case for AC::Live will be for websockets, it would
be nice to set a websocket adapter that "just worked" by hooking into
AC::Live.

If we can provide a real IO object, it should just be a matter of mixing
in another module. I'd suggest we get AC::Live implemented in terms of
hijack before figuring this out.

Hey Aaron,

Sorry I let this go stale but “real world” got in the way this past month.

Anyway, I’m back on this.

I’ll send a PR for this soonish. I think the first pass will just be to replace to response.stream object with the rack.hijack_io socket. This will change the API somewhat but we can work from there. Perhaps a proxy object wrapping the socket?