Class: Baykit::BayServer::Agent::Multiplexer::RudderState
- Inherits:
-
Object
- Object
- Baykit::BayServer::Agent::Multiplexer::RudderState
- Defined in:
- lib/baykit/bayserver/agent/multiplexer/rudder_state.rb
Instance Attribute Summary collapse
-
#accepting ⇒ Object
Returns the value of attribute accepting.
-
#buf_size ⇒ Object
readonly
Returns the value of attribute buf_size.
-
#bytes_read ⇒ Object
Returns the value of attribute bytes_read.
-
#bytes_wrote ⇒ Object
Returns the value of attribute bytes_wrote.
-
#closed ⇒ Object
Returns the value of attribute closed.
-
#connecting ⇒ Object
Returns the value of attribute connecting.
-
#finale ⇒ Object
Returns the value of attribute finale.
-
#handshaking ⇒ Object
Returns the value of attribute handshaking.
-
#last_access_time ⇒ Object
readonly
Returns the value of attribute last_access_time.
-
#multiplexer ⇒ Object
Returns the value of attribute multiplexer.
-
#read_buf ⇒ Object
readonly
Returns the value of attribute read_buf.
-
#reading ⇒ Object
Returns the value of attribute reading.
-
#reading_lock ⇒ Object
readonly
Returns the value of attribute reading_lock.
-
#rudder ⇒ Object
readonly
Returns the value of attribute rudder.
-
#transporter ⇒ Object
readonly
Returns the value of attribute transporter.
-
#write_queue ⇒ Object
readonly
Returns the value of attribute write_queue.
-
#write_queue_lock ⇒ Object
readonly
Returns the value of attribute write_queue_lock.
-
#writing ⇒ Object
Returns the value of attribute writing.
-
#writing_lock ⇒ Object
readonly
Returns the value of attribute writing_lock.
Instance Method Summary collapse
- #access ⇒ Object
- #end ⇒ Object
-
#initialize(rd, tp = nil, timeout_sec = 0) ⇒ RudderState
constructor
A new instance of RudderState.
- #to_s ⇒ Object
Constructor Details
#initialize(rd, tp = nil, timeout_sec = 0) ⇒ RudderState
Returns a new instance of RudderState.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/baykit/bayserver/agent/multiplexer/rudder_state.rb', line 31 def initialize(rd, tp = nil, timeout_sec = 0) @rudder = rd @transporter = tp @closed = false @timeout_sec = timeout_sec if tp != nil @buf_size = tp.get_read_buffer_size @handshaking = tp.secure() ? true : false else @buf_size = 8192 @handshaking = false end @read_buf = " ".b * @buf_size @accepting = false @connecting = false @write_queue = [] @write_queue_lock = Mutex::new @reading_lock = Mutex::new @writing_lock = Mutex::new @reading = false @writing = false @bytes_read = 0 @bytes_wrote = 0 end |
Instance Attribute Details
#accepting ⇒ Object
Returns the value of attribute accepting.
27 28 29 |
# File 'lib/baykit/bayserver/agent/multiplexer/rudder_state.rb', line 27 def accepting @accepting end |
#buf_size ⇒ Object (readonly)
Returns the value of attribute buf_size.
14 15 16 |
# File 'lib/baykit/bayserver/agent/multiplexer/rudder_state.rb', line 14 def buf_size @buf_size end |
#bytes_read ⇒ Object
Returns the value of attribute bytes_read.
19 20 21 |
# File 'lib/baykit/bayserver/agent/multiplexer/rudder_state.rb', line 19 def bytes_read @bytes_read end |
#bytes_wrote ⇒ Object
Returns the value of attribute bytes_wrote.
20 21 22 |
# File 'lib/baykit/bayserver/agent/multiplexer/rudder_state.rb', line 20 def bytes_wrote @bytes_wrote end |
#closed ⇒ Object
Returns the value of attribute closed.
24 25 26 |
# File 'lib/baykit/bayserver/agent/multiplexer/rudder_state.rb', line 24 def closed @closed end |
#connecting ⇒ Object
Returns the value of attribute connecting.
28 29 30 |
# File 'lib/baykit/bayserver/agent/multiplexer/rudder_state.rb', line 28 def connecting @connecting end |
#finale ⇒ Object
Returns the value of attribute finale.
25 26 27 |
# File 'lib/baykit/bayserver/agent/multiplexer/rudder_state.rb', line 25 def finale @finale end |
#handshaking ⇒ Object
Returns the value of attribute handshaking.
16 17 18 |
# File 'lib/baykit/bayserver/agent/multiplexer/rudder_state.rb', line 16 def handshaking @handshaking end |
#last_access_time ⇒ Object (readonly)
Returns the value of attribute last_access_time.
11 12 13 |
# File 'lib/baykit/bayserver/agent/multiplexer/rudder_state.rb', line 11 def last_access_time @last_access_time end |
#multiplexer ⇒ Object
Returns the value of attribute multiplexer.
9 10 11 |
# File 'lib/baykit/bayserver/agent/multiplexer/rudder_state.rb', line 9 def multiplexer @multiplexer end |
#read_buf ⇒ Object (readonly)
Returns the value of attribute read_buf.
13 14 15 |
# File 'lib/baykit/bayserver/agent/multiplexer/rudder_state.rb', line 13 def read_buf @read_buf end |
#reading ⇒ Object
Returns the value of attribute reading.
17 18 19 |
# File 'lib/baykit/bayserver/agent/multiplexer/rudder_state.rb', line 17 def reading @reading end |
#reading_lock ⇒ Object (readonly)
Returns the value of attribute reading_lock.
22 23 24 |
# File 'lib/baykit/bayserver/agent/multiplexer/rudder_state.rb', line 22 def reading_lock @reading_lock end |
#rudder ⇒ Object (readonly)
Returns the value of attribute rudder.
7 8 9 |
# File 'lib/baykit/bayserver/agent/multiplexer/rudder_state.rb', line 7 def rudder @rudder end |
#transporter ⇒ Object (readonly)
Returns the value of attribute transporter.
8 9 10 |
# File 'lib/baykit/bayserver/agent/multiplexer/rudder_state.rb', line 8 def transporter @transporter end |
#write_queue ⇒ Object (readonly)
Returns the value of attribute write_queue.
15 16 17 |
# File 'lib/baykit/bayserver/agent/multiplexer/rudder_state.rb', line 15 def write_queue @write_queue end |
#write_queue_lock ⇒ Object (readonly)
Returns the value of attribute write_queue_lock.
21 22 23 |
# File 'lib/baykit/bayserver/agent/multiplexer/rudder_state.rb', line 21 def write_queue_lock @write_queue_lock end |
#writing ⇒ Object
Returns the value of attribute writing.
18 19 20 |
# File 'lib/baykit/bayserver/agent/multiplexer/rudder_state.rb', line 18 def writing @writing end |
#writing_lock ⇒ Object (readonly)
Returns the value of attribute writing_lock.
23 24 25 |
# File 'lib/baykit/bayserver/agent/multiplexer/rudder_state.rb', line 23 def writing_lock @writing_lock end |
Instance Method Details
#access ⇒ Object
64 65 66 |
# File 'lib/baykit/bayserver/agent/multiplexer/rudder_state.rb', line 64 def access @last_access_time = Time.now.tv_sec end |
#end ⇒ Object
68 69 70 |
# File 'lib/baykit/bayserver/agent/multiplexer/rudder_state.rb', line 68 def end @finale = true end |
#to_s ⇒ Object
58 59 60 61 |
# File 'lib/baykit/bayserver/agent/multiplexer/rudder_state.rb', line 58 def to_s str = "st(rd=#{@rudder} mpx=#{@multiplexer} tp=#{@transporter})" return str end |