Sha256: 6343e17648366f285e8f07177d00172019482b217b9455e095aeaa792aeb8619

Contents?: true

Size: 495 Bytes

Versions: 8

Compression:

Stored size: 495 Bytes

Contents

module Mutest
  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 # Mutest

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
mutest-0.0.9 lib/mutest/actor/env.rb
mutest-0.0.8 lib/mutest/actor/env.rb
mutest-0.0.7 lib/mutest/actor/env.rb
mutest-0.0.6 lib/mutest/actor/env.rb
mutest-0.0.5 lib/mutest/actor/env.rb
mutest-0.0.4 lib/mutest/actor/env.rb
mutest-0.0.3 lib/mutest/actor/env.rb
mutest-0.0.2 lib/mutest/actor/env.rb