Revision 539ce697
Added by Marc Dequènes over 13 years ago
- ID 539ce69773ef34da62391921430d54c2c159f10e
lib/cyborghood/cyborg.rb | ||
---|---|---|
class Cyborg
|
||
include TaskAspect
|
||
|
||
attr_reader :name, :services, :host_name, :host_fqdn
|
||
attr_reader :name, :services, :host_name, :host_fqdn, :stopping
|
||
|
||
def initialize(services = nil)
|
||
@services = services
|
||
... | ... | |
end
|
||
|
||
@channels = {}
|
||
@stopping = false
|
||
|
||
setup
|
||
|
||
... | ... | |
def stop(condition)
|
||
logger.info "Bot was asked to stop..."
|
||
|
||
@stopping = true
|
||
yield if block_given?
|
||
|
||
case condition
|
||
... | ... | |
|
||
protected
|
||
|
||
def stop_gracefully
|
||
end
|
||
|
||
def try_stop
|
||
logger.info "Bot stopping"
|
||
EventMachine.next_tick { EventMachine.stop_event_loop }
|
Also available in: Unified diff
[evol] Cyborg: advertise when stopping