Sha256: 713f44a3a748632878e250f82aa53432163b5bff4dd7bc623c7a284f28522fe3

Contents?: true

Size: 424 Bytes

Versions: 7

Compression:

Stored size: 424 Bytes

Contents

# frozen_string_literal: true
class Ultravisor::Child::CallReceiver < BasicObject
  def initialize(&blk)
    @blk = blk
  end

  def method_missing(name, *args, &blk)
    rv_q = ::Queue.new
    rv_fail = ::Object.new
    callback = ::Ultravisor::Child::Call.new(name, args, blk, rv_q, rv_fail)
    @blk.call(callback)
    rv_q.pop.tap { |rv| ::Kernel.raise ::Ultravisor::ChildRestartedError.new if rv == rv_fail }
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

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