Re: [Rails-core] Using rack.hijack with ActionController::Live

215 views
Skip to first unread message

Aaron Patterson

unread,
Mar 26, 2013, 12:16:34 PM3/26/13
to rubyonra...@googlegroups.com
On Tue, Mar 26, 2013 at 07:50:53AM -0700, Brian Cardarella wrote:
> 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.

--
Aaron Patterson
http://tenderlovemaking.com/

Brian Cardarella

unread,
Apr 24, 2013, 12:14:49 PM4/24/13
to rubyonra...@googlegroups.com, tende...@ruby-lang.org
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?
Reply all
Reply to author
Forward
0 new messages