kenichi / angelo

Sinatra-like DSL for Reel that supports WebSockets and SSE
Other
303 stars 23 forks source link

Exit the server? #72

Closed stugol closed 7 years ago

stugol commented 7 years ago

How the hell do you exit the server programmatically? Any attempt to call @server.terminate, Thread.terminate or Kernel.exit simply results in an error message - or worse, a complete hang of the process.

kenichi commented 7 years ago

I have to look closer to remind myself, but I think the tests do this in the websocket helpers. I'm about to board a flight, and will poke around en route.

kenichi commented 7 years ago

I found what I was thinking of in the define_app test helper after block. If you're using .run, this should work, though it might complain. I believe this happens with a bare reel server instance as well, so I'm not sure there's anything I can do about it in Angelo. See also the trap INT block in the .run. Hope this helps!