class Object - celluloid-0.16.0 Documentation

# class Object

### Public Class Methods

new() click to toggle source

    # File lib/celluloid/rspec/actor_examples.rb, line 159
    def initialize
      sleep 0.1
    end

### Public Instance Methods

ask_name_with_timeout(other, duration) click to toggle source

    # File lib/celluloid/rspec/actor_examples.rb, line 1024
    def ask_name_with_timeout(other, duration)
      timeout(duration) { other.name }
    end

blocking_call() click to toggle source

    # File lib/celluloid/rspec/actor_examples.rb, line 894
    def blocking_call
      @blocker.block
    end

check_exclusive() click to toggle source

    # File lib/celluloid/rspec/actor_examples.rb, line 676
    def check_exclusive
      exclusive { Celluloid.exclusive? }
    end

check_not_exclusive() click to toggle source

    # File lib/celluloid/rspec/actor_examples.rb, line 672
    def check_not_exclusive
      Celluloid.exclusive?
    end

cleanup() click to toggle source

    # File lib/celluloid/rspec/actor_examples.rb, line 185
    def cleanup
      sleep 0.1
    end

current_thread_name() click to toggle source

    # File lib/celluloid/rspec/actor_examples.rb, line 294
    def current_thread_name
      java_thread.get_name
    end

do_sleep(n) click to toggle source

    # File lib/celluloid/rspec/actor_examples.rb, line 789
    def do_sleep(n)
      @sleeping = true
      sleep n
      @sleeping = false
    end

drink_coffee() click to toggle source

    # File lib/celluloid/rspec/actor_examples.rb, line 728
    def drink_coffee
      @tasks << 'coffee'
    end

eat_donuts() click to toggle source

    # File lib/celluloid/rspec/actor_examples.rb, line 723
    def eat_donuts
      sleep Celluloid::TIMER_QUANTUM
      @tasks << 'donuts'
    end

exclusive_log_task(task) click to toggle source

    # File lib/celluloid/rspec/actor_examples.rb, line 666
    def exclusive_log_task(task)
      sleep Celluloid::TIMER_QUANTUM
      log_task(task)
    end

exclusive_with_block_log_task(task) click to toggle source

    # File lib/celluloid/rspec/actor_examples.rb, line 659
    def exclusive_with_block_log_task(task)
      exclusive do
        sleep Celluloid::TIMER_QUANTUM
        log_task(task)
      end
    end

fire_after(n) click to toggle source

    # File lib/celluloid/rspec/actor_examples.rb, line 797
    def fire_after(n)
      after(n) { @fired = true }
    end

fire_every(n) click to toggle source

    # File lib/celluloid/rspec/actor_examples.rb, line 801
    def fire_every(n)
      @fired = 0
      every(n) { @fired += 1 }
    end

fired() click to toggle source

    # File lib/celluloid/rspec/actor_examples.rb, line 807
    def fired; @fired end

fired?() click to toggle source

    # File lib/celluloid/rspec/actor_examples.rb, line 806
    def fired?; !!@fired end

greet_by_proxy(actor) click to toggle source

    # File lib/celluloid/rspec/actor_examples.rb, line 98
    def greet_by_proxy(actor)
      actor.greet
    end

java_thread() click to toggle source

    # File lib/celluloid/rspec/actor_examples.rb, line 298
    def java_thread
      Thread.current.to_java.getNativeThread
    end

lambaste_subordinate(actor, reason) click to toggle source

    # File lib/celluloid/rspec/actor_examples.rb, line 504
    def lambaste_subordinate(actor, reason)
      @subordinate_lambasted = true
    end

log_task(task) click to toggle source

    # File lib/celluloid/rspec/actor_examples.rb, line 655
    def log_task(task)
      @tasks << task
    end

name() click to toggle source

    # File lib/celluloid/rspec/actor_examples.rb, line 1019
    def name
      sleep 0.5
      :foo
    end

nested_exclusive_example() click to toggle source

    # File lib/celluloid/rspec/actor_examples.rb, line 680
    def nested_exclusive_example
      exclusive { exclusive { nil }; Celluloid.exclusive? }
    end

recursion_test(recurse_through = nil) click to toggle source

    # File lib/celluloid/rspec/actor_examples.rb, line 117
    def recursion_test(recurse_through = nil)
      if recurse_through
        recurse_through.recursion_thunk(Celluloid::Actor.current)
      else
        Celluloid.detect_recursion
      end
    end

recursion_thunk(other) click to toggle source

    # File lib/celluloid/rspec/actor_examples.rb, line 130
    def recursion_thunk(other)
      other.recursion_test
    end

send_signal(value) click to toggle source

    # File lib/celluloid/rspec/actor_examples.rb, line 607
    def send_signal(value)
      signal :ponycopter, value
    end

signal_myself(obj, &block) click to toggle source

    # File lib/celluloid/rspec/actor_examples.rb, line 750
    def signal_myself(obj, &block)
      current_actor.mailbox << obj
      receive(&block)
    end

signaled?() click to toggle source

    # File lib/celluloid/rspec/actor_examples.rb, line 612
    def signaled?; @signaled end

sleeping?() click to toggle source

    # File lib/celluloid/rspec/actor_examples.rb, line 795
    def sleeping?; @sleeping end

subordinate_lambasted?() click to toggle source

    # File lib/celluloid/rspec/actor_examples.rb, line 502
    def subordinate_lambasted?; @subordinate_lambasted; end

to_s() click to toggle source

    # File lib/celluloid/rspec/actor_examples.rb, line 102
    def to_s
      "a ponycopter!"
    end

wait_for_signal() click to toggle source

    # File lib/celluloid/rspec/actor_examples.rb, line 596
    def wait_for_signal
      raise "already signaled" if @signaled

      @waiting = true
      value = wait :ponycopter

      @waiting = false
      @signaled = true
      value
    end

waiting?() click to toggle source

    # File lib/celluloid/rspec/actor_examples.rb, line 611
    def waiting?; @waiting end