class PhusionPassenger::AnalyticsLogger::Connection
Attributes
channel[RW]
mutex[R]
Public Class Methods
new(io)
click to toggle source
# File lib/phusion_passenger/analytics_logger.rb, line 387 def initialize(io) @mutex = Mutex.new @refcount = 1 @channel = MessageChannel.new(io) if io end
Public Instance Methods
connected?()
click to toggle source
# File lib/phusion_passenger/analytics_logger.rb, line 393 def connected? return !!@channel end
disconnect()
click to toggle source
# File lib/phusion_passenger/analytics_logger.rb, line 397 def disconnect @channel.close if @channel @channel = nil end
ref()
click to toggle source
# File lib/phusion_passenger/analytics_logger.rb, line 402 def ref @refcount += 1 end
synchronize() { || ... }
click to toggle source
# File lib/phusion_passenger/analytics_logger.rb, line 413 def synchronize @mutex.synchronize do yield end end
unref()
click to toggle source
# File lib/phusion_passenger/analytics_logger.rb, line 406 def unref @refcount -= 1 if @refcount == 0 disconnect end end