class Celluloid::Condition::Waiter - celluloid-0.15.2 Documentation

# class Celluloid::Condition::Waiter

### Attributes

condition[R]
task[R]

### Public Class Methods

new(condition, task, mailbox) click to toggle source

    # File lib/celluloid/condition.rb, line 7
    def initialize(condition, task, mailbox)
      @condition = condition
      @task = task
      @mailbox = mailbox
    end

### Public Instance Methods

<<(message) click to toggle source

    # File lib/celluloid/condition.rb, line 14
    def <<(message)
      @mailbox << message
    end

wait() click to toggle source

    # File lib/celluloid/condition.rb, line 18
    def wait
      message = @mailbox.receive do |msg|
        msg.is_a?(SignalConditionRequest) && msg.task == Thread.current
      end
      message.value
    end