Changeset 140

Show
Ignore:
Timestamp:
05/25/06 11:12:54 (2 years ago)
Author:
blackhedd
Message:

comments and stuff

Files:

Legend:

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

    r139 r140  
    7474 
    7575    log.debug "Pushed EventableIO (#{@@io_objects.size})" 
     76 
     77    # Give the user a chance to initialize some stuff BEFORE 
     78    # sending the initialization event. We DEFINE that behavior 
     79    # so people can depend on it. 
     80    # A handler for :bind can be added in the initialize block, 
     81    # but in single-threaded programs it can probably also be added 
     82    # after this initialize method completes. 
     83    yield self if block_given? 
     84    send_event( Event.new( :bind )) 
    7685  end 
    7786 
    7887  def schedule_close 
     88    send_event( Event.new( :unbind )) 
    7989    @close_scheduled = true 
    8090  end 
     
    138148      end 
    139149    rescue Errno::EAGAIN 
    140       p "EAGAIN" 
    141150    rescue EOFError, Errno::ECONNRESET 
    142151      schedule_close 
    143       send_event( Event.new( :unbind )) 
    144152    end 
    145     p "Done reading" 
    146153  end 
    147154