-
Notifications
You must be signed in to change notification settings - Fork 87
'stop' method for Rack::Handler::Reel #43
Comments
@digitalextremist I don't believe there is a class method for terminate. |
I will look at that, but what I mean is, def self.stop is not satisfying the requirement for a stop method on Rack::Handler::Reel, and I am not sure why @halorgium. |
Use an instance method. |
Unfortunately I didn't write the Rack adapter and don't know a whole lot about how it works :( Ideally it has access to the Reel instance servicing the requests, and the |
Ok, cool. Thanks to you both. I'll go with an instance method and follow the breadcrumbs on what you just said to try to gracefully kill Reel. _why oh _why am I the one to stumble upon where the sidewalks end :) This isn't ridiculously important, thankfully. |
@digitalextremist you are defining a class method on the |
Don't worry, I get what you're saying @halorgium. What's still true is that regardless, no stop in any form exists right now. Experimenting with def stop. OK. def stop works, now I need to move on to what @tarcieri said about finding the place to terminate Reel. I am not sufficiently acquainted with Celluloid to know where that might be, but I look forward to knowing that. |
Hahaha. Please, please no one post a pull request with a functioning def stop. I want my first contribution to be "stopping Reel" :) |
@digitalextremist go for it |
Progress! So far I've figured out how to make sure that Reel never, ever dies, no matter how many times you try to kill it, short of a -9. |
Ok I figured it out, I think. This seems to work immediately and cleanly, in this order: def stop
Celluloid::Actor[:reel_server].terminate
Celluloid::Actor[:reel_rack_pool].terminate
exit
end Without each of those lines, Reel seems to either keep going, or not kill some part of itself, itself. |
You might want to keep celluloid/celluloid#150 in mind. |
If that seems right I'll post a pull request with it. Is exit bad form here? It seems to be all that works to actually put a bullet in Reel. |
|
Cool! I have affected death properly. I will commit my dr. kevorkian pull request. |
I do have to suggest that |
When I graduate from Celluloid University I'll come touch up my first commit to Reel with that in mind @halorgium. |
Shutting down a Rack-based implementation of Reel with Ctrl-C, the above fires, so there is no graceful shutdown... even though the previous line in the console is Terminating # actors...
Tried adding this tp Rack::Handler::Reel, but it doesn't seem to help:
The text was updated successfully, but these errors were encountered: