Class: Celluloid::Notifications::Subscriber

### Home Classes Methods

### In Files

- lib/celluloid/notifications.rb

### Parent

Object

### Methods

- ::new
- #matches?
- #publish
- #subscribed_to?

### Class/Module Index

Quicksearch

- Celluloid
- Celluloid::Incident
- Celluloid::IncidentLogger
- Celluloid::IncidentLogger::Severity
- Celluloid::IncidentReporter
- Celluloid::IncidentReporter::Formatter
- Celluloid::Internals
- Celluloid::Internals::CPUCounter
- Celluloid::Internals::CallChain
- Celluloid::Internals::Handler
- Celluloid::Internals::Handlers
- Celluloid::Internals::Links
- Celluloid::Internals::Logger
- Celluloid::Internals::Logger::WithBacktrace
- Celluloid::Internals::Method
- Celluloid::Internals::Properties
- Celluloid::Internals::Receiver
- Celluloid::Internals::Receivers
- Celluloid::Internals::Registry
- Celluloid::Internals::Response
- Celluloid::Internals::Response::Block
- Celluloid::Internals::Response::Error
- Celluloid::Internals::Response::Success
- Celluloid::Internals::Signals
- Celluloid::Internals::Stack
- Celluloid::Internals::Stack::ActorState
- Celluloid::Internals::Stack::CellState
- Celluloid::Internals::Stack::DisplayBacktrace
- Celluloid::Internals::Stack::Dump
- Celluloid::Internals::Stack::Summary
- Celluloid::Internals::Stack::TaskState
- Celluloid::Internals::Stack::ThreadState
- Celluloid::Internals::TaskSet
- Celluloid::Internals::ThreadHandle
- Celluloid::Internals::UUID
- Celluloid::LogEvent
- Celluloid::Notifications
- Celluloid::Notifications::Fanout
- Celluloid::Notifications::Subscriber
- Celluloid::Probe
- Celluloid::RingBuffer

No matching classes.

# Celluloid::Notifications::Subscriber

### Attributes

actor[RW]
method[RW]
pattern[RW]

### Public Class Methods

new(actor, pattern, method) click to toggle source

    # File lib/celluloid/notifications.rb, line 68
    def initialize(actor, pattern, method)
      @actor = actor
      @pattern = pattern
      @method = method
    end

### Public Instance Methods

matches?(subscriber_or_pattern) click to toggle source

    # File lib/celluloid/notifications.rb, line 85
    def matches?(subscriber_or_pattern)
      self === subscriber_or_pattern ||
        @pattern && @pattern === subscriber_or_pattern
    end

publish(pattern, *args) click to toggle source

    # File lib/celluloid/notifications.rb, line 74
    def publish(pattern, *args)
      actor.async method, pattern, *args
    rescue DeadActorError
      # TODO: needs a tests
      # Bad shutdown logic. Oh well....
    end

subscribed_to?(pattern) click to toggle source

    # File lib/celluloid/notifications.rb, line 81
    def subscribed_to?(pattern)
      !pattern || @pattern === pattern.to_s || @pattern === pattern
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.