Class: NNQ::Options
- Inherits:
-
Object
- Object
- NNQ::Options
- Defined in:
- lib/nnq/options.rb
Overview
Per-socket configuration. Deliberately tiny — no conflate, no heartbeat command (nng uses TCP keepalive instead). New options should match nng socket option names where they exist (‘recv_max_size`, `reconnect_time`, `send_buf`, etc.).
‘send_hwm` bounds *one shared queue per socket*, not per peer. See DESIGN.md “Per-socket HWM”.
Constant Summary collapse
- DEFAULT_HWM =
1000
Instance Attribute Summary collapse
-
#linger ⇒ Object
Returns the value of attribute linger.
-
#max_message_size ⇒ Object
Returns the value of attribute max_message_size.
-
#read_timeout ⇒ Object
Returns the value of attribute read_timeout.
-
#reconnect_interval ⇒ Object
Returns the value of attribute reconnect_interval.
-
#send_hwm ⇒ Object
Returns the value of attribute send_hwm.
-
#survey_time ⇒ Object
Returns the value of attribute survey_time.
-
#write_timeout ⇒ Object
Returns the value of attribute write_timeout.
Instance Method Summary collapse
-
#initialize(linger: Float::INFINITY, send_hwm: DEFAULT_HWM) ⇒ Options
constructor
A new instance of Options.
Constructor Details
#initialize(linger: Float::INFINITY, send_hwm: DEFAULT_HWM) ⇒ Options
Returns a new instance of Options.
27 28 29 30 31 32 33 34 35 |
# File 'lib/nnq/options.rb', line 27 def initialize(linger: Float::INFINITY, send_hwm: DEFAULT_HWM) @linger = linger @read_timeout = nil @write_timeout = nil @reconnect_interval = 0.1 @max_message_size = nil @send_hwm = send_hwm @survey_time = 1.0 end |
Instance Attribute Details
#linger ⇒ Object
Returns the value of attribute linger.
15 16 17 |
# File 'lib/nnq/options.rb', line 15 def linger @linger end |
#max_message_size ⇒ Object
Returns the value of attribute max_message_size.
19 20 21 |
# File 'lib/nnq/options.rb', line 19 def @max_message_size end |
#read_timeout ⇒ Object
Returns the value of attribute read_timeout.
16 17 18 |
# File 'lib/nnq/options.rb', line 16 def read_timeout @read_timeout end |
#reconnect_interval ⇒ Object
Returns the value of attribute reconnect_interval.
18 19 20 |
# File 'lib/nnq/options.rb', line 18 def reconnect_interval @reconnect_interval end |
#send_hwm ⇒ Object
Returns the value of attribute send_hwm.
20 21 22 |
# File 'lib/nnq/options.rb', line 20 def send_hwm @send_hwm end |
#survey_time ⇒ Object
Returns the value of attribute survey_time.
21 22 23 |
# File 'lib/nnq/options.rb', line 21 def survey_time @survey_time end |
#write_timeout ⇒ Object
Returns the value of attribute write_timeout.
17 18 19 |
# File 'lib/nnq/options.rb', line 17 def write_timeout @write_timeout end |