Sha256: 179d2312a1e6d622781babac6d911568ea50f44a0e61e257ad3f3b3835971e36

Contents?: true

Size: 496 Bytes

Versions: 8

Compression:

Stored size: 496 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]
      def spawn
        mailbox = new_mailbox

        thread_root.new do
          yield mailbox
        end

        mailbox.sender
      end

      # New unbound mailbox
      #
      # @return [Mailbox]
      def new_mailbox
        Mailbox.new
      end

    end # Env
  end # Actor
end # Mutant

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
mutant-0.8.16 lib/mutant/actor/env.rb
mutant-0.8.15 lib/mutant/actor/env.rb
mutant-0.8.14 lib/mutant/actor/env.rb
mutant-0.8.13 lib/mutant/actor/env.rb
mutant-0.8.12 lib/mutant/actor/env.rb
mutant-0.8.11 lib/mutant/actor/env.rb
mutant-0.8.10 lib/mutant/actor/env.rb
mutant-0.8.9 lib/mutant/actor/env.rb