Class: ProconBypassMan::Procon::PerformanceMeasurement::QueueOverProcess

Inherits:
Object
  • Object
show all
Extended by:
CanOverProcess
Includes:
Singleton
Defined in:
lib/procon_bypass_man/procon/performance_measurement/queue_over_process.rb

Constant Summary

Constants included from CanOverProcess

CanOverProcess::PROTOCOL

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from CanOverProcess

distributed_class, enable?, extended, shutdown_distributed_object, socket_file_path, socket_path, start_distributed_object!

Constructor Details

#initializeQueueOverProcess

Returns a new instance of QueueOverProcess.



35
36
37
# File 'lib/procon_bypass_man/procon/performance_measurement/queue_over_process.rb', line 35

def initialize
  @distributed_queue = DRbObject.new_with_uri(self.class.socket_path)
end

Instance Attribute Details

#distributed_queueObject (readonly)

Returns the value of attribute distributed_queue.



6
7
8
# File 'lib/procon_bypass_man/procon/performance_measurement/queue_over_process.rb', line 6

def distributed_queue
  @distributed_queue
end

Class Method Details

.distributed_classObject



14
15
16
# File 'lib/procon_bypass_man/procon/performance_measurement/queue_over_process.rb', line 14

def self.distributed_class
  ProconBypassMan::Procon::PerformanceMeasurement::SpanQueue
end

.enable?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/procon_bypass_man/procon/performance_measurement/queue_over_process.rb', line 9

def self.enable?
  ProconBypassMan.config.enable_procon_performance_measurement?
end

.popObject



29
30
31
32
33
# File 'lib/procon_bypass_man/procon/performance_measurement/queue_over_process.rb', line 29

def self.pop
  return unless enable?

  instance.distributed_queue.pop
end

.push(value) ⇒ Object



23
24
25
26
27
# File 'lib/procon_bypass_man/procon/performance_measurement/queue_over_process.rb', line 23

def self.push(value)
  return unless enable?

  instance.distributed_queue.push(value)
end

.socket_file_pathObject



19
20
21
# File 'lib/procon_bypass_man/procon/performance_measurement/queue_over_process.rb', line 19

def self.socket_file_path
  "/tmp/procon_bypass_man_procon_performance_queue".freeze
end