Class: Celluloid::Internals::Handlers

### Home Classes Methods

### In Files

- lib/celluloid/internals/handlers.rb

### Parent

Object

### Methods

- ::new
- #handle
- #handle_message

### 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::Internals::Handlers

### Public Class Methods

new() click to toggle source

    # File lib/celluloid/internals/handlers.rb, line 6
    def initialize
      @handlers = Set.new
    end

### Public Instance Methods

handle(*patterns, &block) click to toggle source

    # File lib/celluloid/internals/handlers.rb, line 10
    def handle(*patterns, &block)
      patterns.each do |pattern|
        handler = Handler.new pattern, block
        @handlers << handler
      end
    end

handle_message(message) click to toggle source

Handle incoming messages

    # File lib/celluloid/internals/handlers.rb, line 18
    def handle_message(message)
      handler = @handlers.find { |h| h.match(message) }
      handler.call message if handler
      handler
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.