Parent

Class/Module Index [+]

Quicksearch

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 386
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 392
def connected?
        return !!@channel
end
disconnect() click to toggle source
# File lib/phusion_passenger/analytics_logger.rb, line 396
def disconnect
        @channel.close if @channel
        @channel = nil
end
ref() click to toggle source
# File lib/phusion_passenger/analytics_logger.rb, line 401
def ref
        @refcount += 1
end
synchronize() click to toggle source
# File lib/phusion_passenger/analytics_logger.rb, line 412
def synchronize
        @mutex.synchronize do
                yield
        end
end
unref() click to toggle source
# File lib/phusion_passenger/analytics_logger.rb, line 405
def unref
        @refcount -= 1
        if @refcount == 0
                disconnect
        end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.