class Celluloid::Receiver - celluloid-0.16.0 Documentation

# class Celluloid::Receiver

Methods blocking on a call to receive

### Attributes

timer[RW]

### Public Class Methods

new(block) click to toggle source

    # File lib/celluloid/receivers.rb, line 48
    def initialize(block)
      @block = block
      @task  = Task.current
      @timer = nil
    end

### Public Instance Methods

match(message) click to toggle source

Match a message with this receiver's block

    # File lib/celluloid/receivers.rb, line 55
    def match(message)
      @block ? @block.call(message) : true
    end

resume(message = nil) click to toggle source

    # File lib/celluloid/receivers.rb, line 59
    def resume(message = nil)
      @task.resume message
    end