Sha256: 2f7f2431dad3bebad47de9f7eaadfeea1ef63791c7403923b613db6fb2ddc134
Contents?: true
Size: 811 Bytes
Versions: 11
Compression:
Stored size: 811 Bytes
Contents
module Celluloid module Internals # Linked actors send each other system events class Links include Enumerable def initialize @links = {} end # Add an actor to the current links def <<(actor) @links[actor.mailbox.address] = actor end # Do links include the given actor? def include?(actor) @links.key? actor.mailbox.address end # Remove an actor from the links def delete(actor) @links.delete actor.mailbox.address end # Iterate through all links def each @links.each { |_, actor| yield(actor) } end # Generate a string representation def inspect links = map(&:inspect).join(",") "#<#{self.class}[#{links}]>" end end end end
Version data entries
11 entries across 11 versions & 2 rubygems