Class: PhusionPassenger::AnalyticsLogger::SharedData

Class PhusionPassenger::AnalyticsLogger::SharedData |
In: | lib/phusion_passenger/analytics_logger.rb
Parent: | Object

Methods

- disconnect
- new
- ref
- synchronize
- unref

Attributes

[RW] | client |

Public Class methods
new()

[ show source ]

         # File lib/phusion_passenger/analytics_logger.rb, line 267
    267:                 def initialize
    268:                         @mutex = Mutex.new
    269:                         @refcount = 1
    270:                 end

Public Instance methods
disconnect(check_error_response = false)

[ show source ]

         # File lib/phusion_passenger/analytics_logger.rb, line 272
    272:                 def disconnect(check_error_response = false)
    273:                         # TODO: implement check_error_response support
    274:                         @client.close if @client
    275:                 end

ref()

[ show source ]

         # File lib/phusion_passenger/analytics_logger.rb, line 277
    277:                 def ref
    278:                         @refcount += 1
    279:                 end

synchronize() {|| ...}

[ show source ]

         # File lib/phusion_passenger/analytics_logger.rb, line 288
    288:                 def synchronize
    289:                         @mutex.synchronize do
    290:                                 yield
    291:                         end
    292:                 end

unref()

[ show source ]

         # File lib/phusion_passenger/analytics_logger.rb, line 281
    281:                 def unref
    282:                         @refcount -= 1
    283:                         if @refcount == 0
    284:                                 disconnect
    285:                         end
    286:                 end