Sha256: 761c851e333be7405fde7045321943b10fff4887999d8180c0ca2760edac3dcb

Contents?: true

Size: 707 Bytes

Versions: 8

Compression:

Stored size: 707 Bytes

Contents

# frozen_string_literal: true
module Ultravisor::Child::ProcessCastCall
  private

  def process_castcall
    begin
      loop do
        item = @ultravisor_child_castcall_queue.pop(true)

        # Queue has been closed, which is a polite way of saying "we're done here"
        return if item.nil?

        item.go!(self)

        castcall_fd.getc
      end
    rescue ThreadError => ex
      if ex.message != "queue empty"
        #:nocov:
        raise
        #:nocov:
      end
    end
  end

  def castcall_fd
    @ultravisor_child_castcall_fd
  end

  def process_castcall_loop
    #:nocov:
    loop do
      IO.select([castcall_fd], nil, nil)

      process_castcall
    end
    #:nocov:
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
service_skeleton-2.2.0 ultravisor/lib/ultravisor/child/process_cast_call.rb
service_skeleton-2.1.0 ultravisor/lib/ultravisor/child/process_cast_call.rb
service_skeleton-1.0.5 ultravisor/lib/ultravisor/child/process_cast_call.rb
service_skeleton-2.0.2 ultravisor/lib/ultravisor/child/process_cast_call.rb
service_skeleton-2.0.1 ultravisor/lib/ultravisor/child/process_cast_call.rb
service_skeleton-2.0.0 ultravisor/lib/ultravisor/child/process_cast_call.rb
service_skeleton-1.0.4 ultravisor/lib/ultravisor/child/process_cast_call.rb
service_skeleton-0.0.0.1.ENOTAG ultravisor/lib/ultravisor/child/process_cast_call.rb