Method: Faye::Engine::Proxy#initialize

Defined in:
lib/faye/engines/proxy.rb

#initialize(options) ⇒ Proxy

Returns a new instance of Proxy.



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/faye/engines/proxy.rb', line 39

def initialize(options)
  super()

  @options     = options
  @connections = {}
  @interval    = @options[:interval] || INTERVAL
  @timeout     = @options[:timeout]  || TIMEOUT

  engine_class = @options[:type] || Memory
  @engine      = engine_class.create(self, @options)

  bind :close do |client_id|
    EventMachine.next_tick { flush_connection(client_id) }
  end

  debug('Created new engine: ?', @options)
end