Changeset 147

Show
Ignore:
Timestamp:
05/26/06 19:04:46 (2 years ago)
Author:
blackhedd
Message:

convenience method to run the reactor with a startup block

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • experiments/machine/lib/machine/reactor.rb

    r145 r147  
    88    #-- 
    99    # Convenience method 
    10     def self.run 
     10    # Takes a block that is executed off a zero-length timer. 
     11    # That guarantees that the reactor is running when the block executes. 
     12    def self.run &block 
     13      Timeout.new(0) {yield} if block_given? 
    1114      instance.run 
    1215    end