Linked actors send each other system events
# File lib/celluloid/links.rb, line 6 def initialize @links = {} end
Add an actor to the current links
# File lib/celluloid/links.rb, line 11 def <<(actor) @links[actor.mailbox.address] = actor end
Remove an actor from the links
# File lib/celluloid/links.rb, line 21 def delete(actor) @links.delete actor.mailbox.address end
Iterate through all links
# File lib/celluloid/links.rb, line 26 def each @links.each { |_, actor| yield(actor) } end
Do links include the given actor?
# File lib/celluloid/links.rb, line 16 def include?(actor) @links.has_key? actor.mailbox.address end
Generate a string representation
# File lib/celluloid/links.rb, line 31 def inspect links = self.map(&:inspect).join(',') "#<#{self.class}[#{links}]>" end