lib/concurrent/actress/reference.rb in concurrent-ruby-0.6.0 vs lib/concurrent/actress/reference.rb in concurrent-ruby-0.6.1

- old
+ new

@@ -1,11 +1,11 @@ module Concurrent module Actress # Reference is public interface of Actor instances. It is used for sending messages and can - # be freely passed around the program. It also provides some basic information about the actor - # see {CoreDelegations} + # be freely passed around the program. It also provides some basic information about the actor, + # see {CoreDelegations}. class Reference include TypeCheck include CoreDelegations attr_reader :core @@ -41,17 +41,17 @@ # @raise [Exception] ivar.reason if ivar is #rejected? def ask!(message, ivar = IVar.new) ask(message, ivar).value! end - # behaves as #tell when no ivar and as #ask when ivar + # behaves as {#tell} when no ivar and as {#ask} when ivar def message(message, ivar = nil) - core.on_envelope Envelope.new(message, ivar, Actress.current || Thread.current) + core.on_envelope Envelope.new(message, ivar, Actress.current || Thread.current, self) return ivar || self end def to_s - "#<#{self.class} #{path}>" + "#<#{self.class} #{path} (#{actor_class})>" end alias_method :inspect, :to_s def ==(other)