Class: Adhd::Connection

Inherits:
Object show all
Defined in:
lib/adhd/reactor.rb

Instance Method Summary collapse

Constructor Details

#initializeConnection

def on_teardown(&block)

# Set the handler to be called then a connection is dead
block(self) # Run the teardown handler

end



166
167
168
# File 'lib/adhd/reactor.rb', line 166

def initialize

end

Instance Method Details

#is_closed?Boolean

Returns:

  • (Boolean)


174
175
176
# File 'lib/adhd/reactor.rb', line 174

def is_closed?
  (@status == "NOTRUNNING")
end

#should_start?Boolean

Returns:

  • (Boolean)


170
171
172
# File 'lib/adhd/reactor.rb', line 170

def should_start?
  !(@status == "RUNNING")
end