multithreading - Running a Sinatra app from within Rails breaks CTRL-C behaviour -
as explained here, rails creates trap int signals starts.
i have rails app starts sinatra app in separate thread.
thread.new begin sinatraapp.run! rescue => e puts e.message end end
it seems running sinatra app in separate thread causes rails app no longer respond int signals, meaning can't kill via ctrl-c. sinatra app "steals" of int signals.
how fix this? possible configure rails app ctrl-c kills both , sinatra app?
my sinatra app booting via webrick. found using jruby-based server instead, puma or trinidad (with trap
flag set false
), solved problem.
this answer helped me find solution.
Comments
Post a Comment