"Lin Jen-Shin (godfat)" <god...@godfat.org> wrote:
> Just tried it, but not sure where to put this.
> With preload=true, yahns is trapping later than
> the application. Maybe I should just set it to false
> since we're not forking anyway...

Anywhere in your normal app dispatch path, just initialize the
lock during application load (regardless of preload value)

  def initialize(...)
    @lock = Mutex.new
    @old_quit = nil
  end

  def call(env)
    unless @old_quit
      @lock.synchronize do
        @old_quit ||= trap(:QUIT) do
          app_specific_quit
          @old_quit.call
        end
      end
    end
    ...
  end
--
unsubscribe: yahns-public+unsubscr...@yhbt.net
archive: http://yhbt.net/yahns-public/

Reply via email to