Sha256: a593f58b07e66d9ee773487953a1768c587a96fbc798f6e39d8ccaf9dedf90c6

Contents?: true

Size: 781 Bytes

Versions: 8

Compression:

Stored size: 781 Bytes

Contents

module Mutant
  module Actor
    # Unbound mailbox
    class Mailbox
      include Adamantium::Flat, Concord::Public.new(:receiver, :sender)

      # New mailbox
      #
      # @return [Mailbox]
      #
      # @api private
      def self.new
        mutex              = Mutex.new
        condition_variable = ConditionVariable.new
        messages           = []

        super(
          Receiver.new(condition_variable, mutex, messages),
          Sender.new(condition_variable, mutex, messages)
        )
      end

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

    end # Mailbox
  end # Actor
end # Mutant

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
mutant-0.8.8 lib/mutant/actor/mailbox.rb
mutant-0.8.7 lib/mutant/actor/mailbox.rb
mutant-0.8.6 lib/mutant/actor/mailbox.rb
mutant-0.8.5 lib/mutant/actor/mailbox.rb
mutant-0.8.4 lib/mutant/actor/mailbox.rb
mutant-0.8.3 lib/mutant/actor/mailbox.rb
mutant-0.8.2 lib/mutant/actor/mailbox.rb
mutant-0.8.1 lib/mutant/actor/mailbox.rb