Sha256: 2fd62228daae471293f7d9b51ac6fe43f2fbcf2f4c161bd6a8a346fc12698296

Contents?: true

Size: 642 Bytes

Versions: 12

Compression:

Stored size: 642 Bytes

Contents

# encoding: utf-8

module FiniteMachine
  # An asynchronous messages proxy
  class AsyncProxy
    include Threadable
    include ThreadContext

    attr_threadsafe :context

    # Initialize an AsynxProxy
    #
    # @param [Object] context
    #   the context this proxy is associated with
    #
    # @api private
    def initialize(context)
      self.context = context
    end

    # Delegate asynchronous event to event queue
    #
    # @api private
    def method_missing(method_name, *args, &block)
      event_queue << AsyncCall.build(context, Callable.new(method_name), *args, &block)
    end
  end # AsyncProxy
end # FiniteMachine

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
finite_machine-0.9.2 lib/finite_machine/async_proxy.rb
finite_machine-0.9.1 lib/finite_machine/async_proxy.rb
finite_machine-0.9.0 lib/finite_machine/async_proxy.rb
finite_machine-0.8.1 lib/finite_machine/async_proxy.rb
finite_machine-0.8.0 lib/finite_machine/async_proxy.rb
finite_machine-0.7.1 lib/finite_machine/async_proxy.rb
finite_machine-0.7.0 lib/finite_machine/async_proxy.rb
finite_machine-0.6.1 lib/finite_machine/async_proxy.rb
finite_machine-0.6.0 lib/finite_machine/async_proxy.rb
finite_machine-0.5.0 lib/finite_machine/async_proxy.rb
finite_machine-0.4.0 lib/finite_machine/async_proxy.rb
finite_machine-0.3.0 lib/finite_machine/async_proxy.rb