Sha256: 1b2d7b55b7274dce4a8fe3f6722c0d5d20c0268f06c0315470f19775d90e4acd

Contents?: true

Size: 910 Bytes

Versions: 1

Compression:

Stored size: 910 Bytes

Contents

module Mutant
  module Actor
    # Actor object available to acting threads
    class Actor
      include Concord.new(:thread, :mailbox)

      # Initialize object
      #
      # @return [undefined]
      #
      # @api private
      #
      def initialize(*)
        super
        @sender = mailbox.sender(thread)
      end

      # Return sender to this actor
      #
      # @return [Sender]
      #
      # @api private
      #
      attr_reader :sender

      # Return receiver for messages to this actor
      #
      # @return [Receiver]
      #
      # @api private
      #
      def receiver
        mailbox.receiver
      end

      # Return binding for RPC to other actors
      #
      # @param [Actor::Sender] other
      #
      # @return [Binding]
      #
      # @api private
      #
      def bind(other)
        Binding.new(self, other)
      end

    end # Actor
  end # Actor
end # Mutant

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mutant-0.7.1 lib/mutant/actor/actor.rb