Class: OMQ::MonitorEvent
- Inherits:
-
Data
- Object
- Data
- OMQ::MonitorEvent
- Defined in:
- lib/omq/constants.rb
Overview
Lifecycle event emitted by Socket#monitor.
Instance Attribute Summary collapse
-
#detail ⇒ Hash?
readonly
Extra context (e.g. { error: }, { interval: }, etc.).
-
#endpoint ⇒ String?
readonly
The endpoint involved.
-
#type ⇒ Symbol
readonly
Event type (:listening, :connected, :disconnected, etc.).
Instance Method Summary collapse
-
#initialize(type:, endpoint: nil, detail: nil) ⇒ MonitorEvent
constructor
A new instance of MonitorEvent.
Constructor Details
#initialize(type:, endpoint: nil, detail: nil) ⇒ MonitorEvent
Returns a new instance of MonitorEvent.
29 |
# File 'lib/omq/constants.rb', line 29 def initialize(type:, endpoint: nil, detail: nil) = super |
Instance Attribute Details
#detail ⇒ Hash? (readonly)
Returns extra context (e.g. { error: }, { interval: }, etc.).
28 29 30 |
# File 'lib/omq/constants.rb', line 28 MonitorEvent = Data.define(:type, :endpoint, :detail) do def initialize(type:, endpoint: nil, detail: nil) = super end |
#endpoint ⇒ String? (readonly)
Returns the endpoint involved.
28 29 30 |
# File 'lib/omq/constants.rb', line 28 MonitorEvent = Data.define(:type, :endpoint, :detail) do def initialize(type:, endpoint: nil, detail: nil) = super end |
#type ⇒ Symbol (readonly)
Returns event type (:listening, :connected, :disconnected, etc.).
28 29 30 |
# File 'lib/omq/constants.rb', line 28 MonitorEvent = Data.define(:type, :endpoint, :detail) do def initialize(type:, endpoint: nil, detail: nil) = super end |