Class: CWlogsIO::HandlerManager

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/cwlogs_io/handler.rb

Instance Method Summary collapse

Constructor Details

#initializeHandlerManager

Returns a new instance of HandlerManager.



36
37
38
# File 'lib/cwlogs_io/handler.rb', line 36

def initialize
  @handlers = Set.new
end

Instance Method Details

#deregister(handler) ⇒ Object



48
49
50
# File 'lib/cwlogs_io/handler.rb', line 48

def deregister(handler)
  @handlers.delete(handler)
end

#register(handler) ⇒ Object



44
45
46
# File 'lib/cwlogs_io/handler.rb', line 44

def register(handler)
  @handlers << handler
end

#respawn_allObject



40
41
42
# File 'lib/cwlogs_io/handler.rb', line 40

def respawn_all
  @handlers.each(&:respawn)
end