Class: Cybertrain::WebSocket::Status
- Inherits:
-
Object
- Object
- Cybertrain::WebSocket::Status
- Defined in:
- cybertrain/websocket.rb
Overview
A snapshot of a subscription’s state, from feed_status.
Instance Method Summary collapse
-
#connected? ⇒ Boolean
Whether the feed is connected now.
-
#last_message_at ⇒ Integer
Epoch seconds of the last message, 0 for none yet.
-
#reconnects ⇒ Integer
How many times the feed connected again after its first connection.
-
#restarts ⇒ Integer
How many times the supervisor started the feed’s thread again after it ended.
- #thread_alive? ⇒ Boolean
Instance Method Details
#connected? ⇒ Boolean
Returns whether the feed is connected now.
131 132 133 |
# File 'cybertrain/websocket.rb', line 131 def connected? @connected end |
#last_message_at ⇒ Integer
Returns epoch seconds of the last message, 0 for none yet.
137 138 139 |
# File 'cybertrain/websocket.rb', line 137 def @last_message_at end |
#reconnects ⇒ Integer
Returns how many times the feed connected again after its first connection.
144 145 146 |
# File 'cybertrain/websocket.rb', line 144 def reconnects @reconnects end |
#restarts ⇒ Integer
Returns how many times the supervisor started the feed’s thread again after it ended.
151 152 153 |
# File 'cybertrain/websocket.rb', line 151 def restarts @restarts end |
#thread_alive? ⇒ Boolean
Returns whether the feed’s thread is running (false before Cybertrain::WebSocket.start!, after Cybertrain::WebSocket.stop!, and between the thread’s death and its restart).
159 160 161 |
# File 'cybertrain/websocket.rb', line 159 def thread_alive? @thread_alive end |