Sha256: 7d540b1572e8d676ecdf790b919f3efc3f495d6834a6bf8fce0625cdc29be248

Contents?: true

Size: 523 Bytes

Versions: 11

Compression:

Stored size: 523 Bytes

Contents

# 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
#
# POSIX pipe version, see queue_quitter.rb for the (preferred) eventfd one
class Yahns::QueueQuitter # :nodoc:
  attr_reader :to_io
  def initialize
    @reader, @to_io = IO.pipe
    @to_io.close_on_exec = true
  end

  def yahns_step
    Thread.current.exit
  end

  def fileno
    @to_io.fileno
  end

  def close
    @reader.close
    @to_io.close
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
yahns-1.16.0 lib/yahns/queue_quitter_pipe.rb
yahns-1.15.0 lib/yahns/queue_quitter_pipe.rb
yahns-1.14.1 lib/yahns/queue_quitter_pipe.rb
yahns-1.14.0 lib/yahns/queue_quitter_pipe.rb
yahns-1.13.0 lib/yahns/queue_quitter_pipe.rb
yahns-1.12.5 lib/yahns/queue_quitter_pipe.rb
yahns-1.12.4 lib/yahns/queue_quitter_pipe.rb
yahns-1.12.3 lib/yahns/queue_quitter_pipe.rb
yahns-1.12.2 lib/yahns/queue_quitter_pipe.rb
yahns-1.12.1 lib/yahns/queue_quitter_pipe.rb
yahns-1.12.0 lib/yahns/queue_quitter_pipe.rb