Method: Pressure#initialize

Defined in:
lib/pressure.rb

#initialize(options = {}, &data_source_block) ⇒ Pressure

Returns a new instance of Pressure.



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

def initialize(options = {}, &data_source_block)
  @wrapper_template = {}
  @current_upstream = {}
  @send_queue = Queue.new
  @sockets = []
  @websocket_worker_delay = options[:websocket_worker_delay] || (1.0 / 20.0)
  @incoming_monitor_delay = options[:incoming_monitor_delay] || (1.0 / 20.0)
  @no_wrap = options[:no_wrap] || false
  incoming_monitor(&data_source_block)
  websocket_worker_loop
end