Class: Skyfall::Firehose::InfoMessage
- Inherits:
-
Firehose::Message
- Object
- Firehose::Message
- Skyfall::Firehose::InfoMessage
- Defined in:
- lib/skyfall/firehose/info_message.rb
Overview
An informational firehose message from the websocket service itself, unrelated to any repos.
Currently there is only one type of message defined, "OutdatedCursor", which is sent when
the client connects with a cursor that is older than the oldest event currently kept in the
backfill buffer. This message means that you're likely missing some events that were sent
since the last time the client was connected but which were already deleted from the buffer.
Note: the #did, #seq and #time properties are always nil for #info messages.
Constant Summary collapse
- OUTDATED_CURSOR =
Message which means that the cursor passed when connecting is older than the oldest event currently kept in the backfill buffer, and that you've likely missed some events that have already been deleted
"OutdatedCursor"
Instance Attribute Summary collapse
-
#message ⇒ String?
readonly
A human-readable description.
-
#name ⇒ String
readonly
Short machine-readable code of the info message.
Instance Method Summary collapse
-
#initialize(type_object, data_object) ⇒ InfoMessage
constructor
A new instance of InfoMessage.
-
#to_s ⇒ String
A formatted summary.
Constructor Details
#initialize(type_object, data_object) ⇒ InfoMessage
Returns a new instance of InfoMessage.
38 39 40 41 42 43 44 |
# File 'lib/skyfall/firehose/info_message.rb', line 38 def initialize(type_object, data_object) super check_if_not_nil 'name' @name = @data_object['name'] @message = @data_object['message'] end |
Instance Attribute Details
#message ⇒ String? (readonly)
Returns a human-readable description.
25 26 27 |
# File 'lib/skyfall/firehose/info_message.rb', line 25 def @message end |
#name ⇒ String (readonly)
Returns short machine-readable code of the info message.
22 23 24 |
# File 'lib/skyfall/firehose/info_message.rb', line 22 def name @name end |
Instance Method Details
#to_s ⇒ String
Returns a formatted summary.
47 48 49 |
# File 'lib/skyfall/firehose/info_message.rb', line 47 def to_s (@name || "InfoMessage") + (@message ? ": #{@message}" : "") end |