-
Notifications
You must be signed in to change notification settings - Fork 21.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Eliminate the EventMachine dependency #23152
Conversation
👏 |
return true if env['rack.url_scheme'] == 'https' | ||
|
||
return false | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can utilise Rack::Request#ssl?
for this can't we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed.. I'll look at chasing env
-> req
right through in a subsequent change, because I imagine that'll make @tenderlove happy.
@matthewd 👍 - does this mean we could run it all in one server in development mode? |
@matthewd 👍 Does this mean there's work to be done on reloading? |
07fbf3f
to
65e3232
Compare
headers.each { |name, value| @driver.set_header(name, value) } | ||
end | ||
|
||
[*options[:extensions]].each do |extension| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why use two different array handling styles between :headers
and :extensions
?
070ada8
to
73bf1a5
Compare
[ -1, {}, [] ] | ||
end | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✂️ extra space
73bf1a5
to
438587d
Compare
(as adapted to use concurrent-ruby / nio4r instead of eventmachine)
We're no longer doing our work in the EM event loop, so errors are quite unlikely, and if they do occur, they're not really our responsibility to handle.
438587d
to
503fe75
Compare
Eliminate the EventMachine dependency
@todo = Queue.new | ||
|
||
Thread.new do | ||
Thread.current.abort_on_exception = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably don't want this.
Since rails#23152 eliminated the EventMachine dependency, we don’t need to explicitly mention EventMachine. Nevertheless, I'm not 100% sure about saying "the websocket-driver loop" driver… any suggestions, @matthewd or @pixeltrix ? 😅 [ci skip]
Testing this with Basecamp, we're getting two separate exceptions. First:
Which then leads to:
|
@pixeltrix pointed out that it wasn't actually all that infeasible for us to just import the portion of faye-websocket we need... it turns out to only be about 200 lines. So I did that.
All the protocol complexities live in websocket-driver, which we're still using, so we're not taking on any substantial maintenance burden.
For this relatively low cost, I'd contemplate this just to reduce our dependency list by the one gem... but the important part here is that by importing it, we're able to (as I have) then modify it to avoid EventMachine.