Gem breaks Rails 4 SSE / ActionController::Live #24

Closed
opened 2013-01-23 12:14:33 +00:00 by leehambley · 5 comments
leehambley commented 2013-01-23 12:14:33 +00:00 (Migrated from github.com)

I'm sure you could automatically ignore anything with Content-Type matching text/event-stream.

I'm sure you could automatically ignore anything with `Content-Type` matching `text/event-stream`.
johnbintz commented 2013-01-23 14:19:32 +00:00 (Migrated from github.com)

That's odd, since I'm only running anything that's text/html through the processor. Every other Content-Type is being ignored. What exactly is breaking? I haven't had the opportunity to mess w/ any of the Rails 4 streaming code.

That's odd, since I'm only running anything that's `text/html` through the processor. Every other `Content-Type` is being ignored. What exactly is breaking? I haven't had the opportunity to mess w/ any of the Rails 4 streaming code.
leehambley commented 2013-01-23 14:32:20 +00:00 (Migrated from github.com)

I can't say exactly, except with this middleware loaded calls to otherwise streaming endpoints return with a Content-length header, and they return after one iteration of their runloop.

I can't say exactly, except with this middleware loaded calls to otherwise streaming endpoints return with a `Content-length` header, and they return after one iteration of their runloop.
johnbintz commented 2013-01-23 14:40:17 +00:00 (Migrated from github.com)

It must be the close that the middleware is doing on the Rack body object. I'll make some time to play around with the streaming API today and see if that's the case, but that's where my money is right now. Avoiding close when the Content-Type is text/event-stream I bet would fix the issue.

It must be the `close` that the middleware is doing on the Rack body object. I'll make some time to play around with the streaming API today and see if that's the case, but that's where my money is right now. Avoiding `close` when the `Content-Type` is `text/event-stream` I bet would fix the issue.
leehambley commented 2013-01-23 14:43:14 +00:00 (Migrated from github.com)

Almost certainly would @johnbintz, I wonder if the Rack body object looks different in Rails streaming from your POV. At least in ALL examples about how this might work they say it's ESSENTIAL to ensure\n\tresponse.stream.close, which makes your proposed fix safe enough.

Almost certainly would @johnbintz, I wonder if the Rack body object looks different in Rails streaming from your POV. At least in ALL examples about how this might work they say it's ESSENTIAL to `ensure\n\tresponse.stream.close`, which makes your proposed fix safe enough.
johnbintz commented 2013-01-24 15:24:47 +00:00 (Migrated from github.com)

I just rode the Rails 4 SSE wave successfully with rack-livereload running. Hopefully that commit should fix it. Let me know if it doesn't.

I just rode the Rails 4 SSE wave successfully with rack-livereload running. Hopefully that commit should fix it. Let me know if it doesn't.
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: github-migration/rack-livereload#24
No description provided.