yahns.git  about / heads / tags
sleepy, multi-threaded, non-blocking application server for Ruby
blob 916f182f3dc24fb090e7080f0dd371077c4b2102 484 bytes (raw)
$ git show maint:lib/yahns/queue_quitter.rb	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
 
# Copyright (C) 2013-2016 all contributors <yahns-public@yhbt.net>
# License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
# frozen_string_literal: true

require 'sleepy_penguin'

# add this as a level-triggered to any thread pool stuck on epoll_wait
# and watch it die!
if SleepyPenguin.const_defined?(:EventFD)
  class Yahns::QueueQuitter < Yahns::Sigevent # :nodoc:
    def yahns_step
      Thread.current.exit
    end
  end
else
  require_relative 'queue_quitter_pipe'
end

git clone git://yhbt.net/yahns.git
git clone https://yhbt.net/yahns.git