class Celluloid::Links - celluloid-0.15.2 Documentation

# class Celluloid::Links

Linked actors send each other system events

### Public Class Methods

new() click to toggle source

    # File lib/celluloid/links.rb, line 6
    def initialize
      @links = {}
    end

### Public Instance Methods

<<(actor) click to toggle source

Add an actor to the current links

    # File lib/celluloid/links.rb, line 11
    def <<(actor)
      @links[actor.mailbox.address] = actor
    end

delete(actor) click to toggle source

Remove an actor from the links

    # File lib/celluloid/links.rb, line 21
    def delete(actor)
      @links.delete actor.mailbox.address
    end

each() { |actor| ... } click to toggle source

Iterate through all links

    # File lib/celluloid/links.rb, line 26
    def each
      @links.each { |_, actor| yield(actor) }
    end

include?(actor) click to toggle source

Do links include the given actor?

    # File lib/celluloid/links.rb, line 16
    def include?(actor)
      @links.has_key? actor.mailbox.address
    end

inspect() click to toggle source

Generate a string representation

    # File lib/celluloid/links.rb, line 31
    def inspect
      links = self.map(&:inspect).join(',')
      "#<#{self.class}[#{links}]>"
    end