module EventMachine::HotTub

Constants

GLOBAL_SESSIONS
VERSION

Public Class Methods

add(url,opts={}, &client_block) click to toggle source

Adds a new Pool to the global sessions

# File lib/em/hot_tub.rb, line 56
def self.add(url,opts={}, &client_block)
  GLOBAL_SESSIONS.add(url, opts, &client_block)
end
jruby?() click to toggle source
# File lib/em/hot_tub.rb, line 35
def self.jruby?
  (defined?(JRUBY_VERSION))
end
log_trace?() click to toggle source
# File lib/em/hot_tub.rb, line 27
def self.log_trace?
  HotTub.log_trace?
end
logger() click to toggle source
# File lib/em/hot_tub.rb, line 12
def self.logger
  HotTub.logger
end
logger=(logger) click to toggle source
# File lib/em/hot_tub.rb, line 16
def self.logger=logger
  HotTub.logger = logger
  HotTub.set_log_trace
end
new(opts={}, &client_block) click to toggle source
# File lib/em/hot_tub.rb, line 65
def self.new(opts={}, &client_block)
  EM::HotTub::Pool.new(opts,&client_block)
end
rbx?() click to toggle source
# File lib/em/hot_tub.rb, line 39
def self.rbx?
  (defined?(RUBY_ENGINE) and RUBY_ENGINE == 'rbx')
end
reset!() click to toggle source

Resets global sessions, useful in forked environments Does not reset one-off pools or one-off sessions

# File lib/em/hot_tub.rb, line 45
def self.reset!
  GLOBAL_SESSIONS.reset!
end
run(url ,&run_block) click to toggle source
# File lib/em/hot_tub.rb, line 60
def self.run(url ,&run_block)
  pool = GLOBAL_SESSIONS.fetch(url)
  pool.run(&run_block)
end
sessions() click to toggle source
# File lib/em/hot_tub.rb, line 31
def self.sessions
  GLOBAL_SESSIONS
end
shutdown!() click to toggle source

Shuts down global sessions, useful in forked environments Does not shutdown one-off pools or one-off sessions

# File lib/em/hot_tub.rb, line 51
def self.shutdown!
  GLOBAL_SESSIONS.shutdown!
end
trace=(trace) click to toggle source

Set to true for more detail logs

# File lib/em/hot_tub.rb, line 22
def self.trace=trace
  HotTub.trace = trace
  HotTub.set_log_trace
end