Sha256: d3bd076c0727773ca1b5aef9afd4cb8fef975d073b9ea692dc626a28bc811a64

Contents?: true

Size: 577 Bytes

Versions: 9

Compression:

Stored size: 577 Bytes

Contents

module Mutant
  module Actor
    # Actor root environment
    class Env
      include Concord.new(:thread_root)

      # Spawn a new actor executing block
      #
      # @return [Actor::Sender]
      #
      # @api private
      #
      def spawn
        mailbox = new_mailbox

        thread_root.new do
          yield mailbox
        end

        mailbox.sender
      end

      # Return new unbound mailbox
      #
      # @return [Mailbox]
      #
      # @api private
      #
      def new_mailbox
        Mailbox.new
      end

    end # Env
  end # Actor
end # Mutant

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
mutant-0.8.0 lib/mutant/actor/env.rb
mutant-0.7.9 lib/mutant/actor/env.rb
mutant-0.7.8 lib/mutant/actor/env.rb
mutant-0.7.7 lib/mutant/actor/env.rb
mutant-0.7.6 lib/mutant/actor/env.rb
mutant-0.7.5 lib/mutant/actor/env.rb
mutant-0.7.4 lib/mutant/actor/env.rb
mutant-0.7.3 lib/mutant/actor/env.rb
mutant-0.7.2 lib/mutant/actor/env.rb