Method: Witch.init

Defined in:
lib/witch.rb

.init(options = {}) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/witch.rb', line 10

def init(options = {})
  raise 'Already initialized!' if @queue
  @queue     = options.delete(:queue) || 'eventstream'
  @logger    = options.delete(:logger)
  @options   = options
  @callbacks = {:once => {}, :on => {}}
  @channels  = []
  @thread    = nil
  @id = Socket.gethostname + '-' + $$.to_s
end