Class: RIMS::Protocol::ConnectionLimits

Inherits:
Object
  • Object
show all
Defined in:
lib/rims/protocol/connection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(read_polling_interval_seconds, command_wait_timeout_seconds) ⇒ ConnectionLimits

Returns a new instance of ConnectionLimits.



8
9
10
11
12
# File 'lib/rims/protocol/connection.rb', line 8

def initialize(read_polling_interval_seconds, command_wait_timeout_seconds)
  @mutex = Thread::Mutex.new
  @read_polling_interval_seconds = read_polling_interval_seconds
  self.command_wait_timeout_seconds = command_wait_timeout_seconds
end

Instance Attribute Details

#read_polling_interval_secondsObject (readonly)

Returns the value of attribute read_polling_interval_seconds.



14
15
16
# File 'lib/rims/protocol/connection.rb', line 14

def read_polling_interval_seconds
  @read_polling_interval_seconds
end

Instance Method Details

#command_wait_timeout_secondsObject



16
17
18
# File 'lib/rims/protocol/connection.rb', line 16

def command_wait_timeout_seconds
  @mutex.synchronize{ @command_wait_timeout_seconds }
end

#command_wait_timeout_seconds=(value) ⇒ Object



20
21
22
# File 'lib/rims/protocol/connection.rb', line 20

def command_wait_timeout_seconds=(value)
  @mutex.synchronize{ @command_wait_timeout_seconds = value }
end

#to_hObject



24
25
26
27
28
29
30
# File 'lib/rims/protocol/connection.rb', line 24

def to_h
  Hash[
    [ :read_polling_interval_seconds,
      :command_wait_timeout_seconds
    ].map{|n| [ n, __send__(n) ] }
  ]
end