[Nitro] Telling WEBrick Nitro to kill itself

George Moschovitis george.moschovitis at gmail.com
Mon Sep 19 03:00:08 EDT 2005


Ok, sounds reasonable, will add this!

-g.

On 9/18/05, James Britt <james_b at neurogami.com> wrote:
> George Moschovitis wrote:
>  > Hm this is not supported at the moment. Moreover, I am not sure how
>  > this could be implemented. Care to give some tips (or even better a
>  > patch?).
> 
> There needs to be way to talk to the WEBrick server variable to issue it
> a shutdown command.
> 
> For example, in Mousehole, which is a WEBrick app,  I added this to my copy:
> 
>   server.mount_proc('/quit') do |req, resp| server.shutdown;  exit;  end
> 
> So I can now call
> 
> http://127.0.0.1:37004/quit
> 
> and mousehole goes away.
> 
>  >
>  > thanks,
>  > -g.
>  >
>  > PS: out of curiosity, where is this feature useful?
>  >
> 
> I sometimes run WEBrick Web apps on windows using rubyw.exe, which does
> not then allow for ctrl-C.  (Same behavior, I think, as following a
> command call with the ampersand on unix).  Simple Ruby services without
> having to have an annoying cmd window sitting around all day.
> 
> So I typically add in a way to send a request to the application to shut
> itself down.  Usually some special URL that maps to code that calls
> server.shutdown.
> 
> James
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general
> 


-- 
http://www.gmosx.com
http://www.navel.gr
http://www.nitrohq.com




More information about the Nitro-general mailing list