Class: AceMQ::AMQP::Patterns::Responder::Counters Private

Inherits:
Object
  • Object
show all
Defined in:
lib/acemq/amqp/patterns/request_reply.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

The two numbers, held apart from the responder that reports them.

A class of its own so the handler can close over it: see AceMQ::AMQP::Patterns.serve for why reaching them through the responder is a number lost at start-up.

Instance Method Summary collapse

Constructor Details

#initialize ⇒ Counters

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Counters.



430
431
432
433
434
# File 'lib/acemq/amqp/patterns/request_reply.rb', line 430

def initialize
  @lock = Mutex.new
  @answered = 0
  @unanswerable = 0
end

Instance Method Details

#answered ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



436
# File 'lib/acemq/amqp/patterns/request_reply.rb', line 436

def answered = @lock.synchronize { @answered }

#answered! ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



438
# File 'lib/acemq/amqp/patterns/request_reply.rb', line 438

def answered! = @lock.synchronize { @answered += 1 }

#unanswerable ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



437
# File 'lib/acemq/amqp/patterns/request_reply.rb', line 437

def unanswerable = @lock.synchronize { @unanswerable }

#unanswerable! ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



439
# File 'lib/acemq/amqp/patterns/request_reply.rb', line 439

def unanswerable! = @lock.synchronize { @unanswerable += 1 }

#unanswered! ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Takes back an increment whose publish then failed.



442
# File 'lib/acemq/amqp/patterns/request_reply.rb', line 442

def unanswered! = @lock.synchronize { @answered -= 1 }