vendor/bundle/ruby/1.8/gems/io-reactor-1.0.4/lib/io/reactor.rb
### Register the specified IO object with the reactor for events given as
### <tt>args</tt>. The reactor will test the given <tt>io</tt> for the
### events specified whenever #poll is called. See the #poll method for a
### list of valid events. If no events are specified, only <tt>:error</tt>
### events will be polled for.
###
### If a <tt>handler</tt> is specified, it will be called whenever the
### <tt>io</tt> has any of the specified <tt>events</tt> occur to it. It
### should take at least two parameters: the <tt>io</tt> and the event.
###
### If +args+ contains any objects except the Symbols '<tt>:read</tt>',
### '<tt>:write</tt>', or '<tt>:error</tt>', and a +handler+ is specified,
### they will be saved and passed to handler for each event.
### 
### Registering a handle will unregister any previously registered
### event/handler+arguments pairs associated with the handle.
Register the specified IO object with the reactor for events given as
args. The reactor will test the given io for the
events specified whenever #poll is called. See the #poll method for a
list of valid events. If no events are specified, only :error
events will be polled for.

If a handler is specified, it will be called whenever the
io has any of the specified events occur to it. It
should take at least two parameters: the io and the event.



Registering a handle will unregister any previously registered
event/handler+arguments pairs associated with the handle.
Register the specified IO object with the reactor for events given as args . The reactor will test the given io for the events specified whenever #poll is called . See the #poll method for a list of valid events . If no events are specified only : error events will be polled for . If a handler is specified it will be called whenever the io has any of the specified events occur to it . It should take at least two parameters : the io and the event . Registering a handle will unregister any previously registered event / handler + arguments pairs associated with the handle .
def register( io, *args, &handler )
		events = VALID_EVENTS & args
		args -= events
		self.unregister( io )
		self.enable_events( io, *events )
		if handler
			self.set_handler( io, *args, &handler )
		else
			self.set_args( io, *args )
		end
		return self
	end
def register ( io , * args , & handler ) events = VALID_EVENTS & args args -= events self . unregister ( io ) self . enable_events ( io , * events ) if handler self . set_handler ( io , * args , & handler ) else self . set_args ( io , * args ) end return self end
Register the specified IO object with the reactor for events given as
<tt>args</tt>.
Register the specified IO object with the reactor for events given as <tt > args< / tt > .
io
args
handler