Class: Skyfall::Firehose::SyncMessage
- Defined in:
- lib/skyfall/firehose/sync_message.rb
Overview
Firehose message which declares the current state of the repository. The message is meant to trigger a resynchronization of the repository from a receiving consumer, if the consumer detects from the message rev that it must have missed some events from that repository.
The sync message can be emitted by a PDS or relay to force a repair of a broken account state, or e.g. when an account is created, migrated or recovered from a CAR backup.
Instance Attribute Summary
Attributes inherited from Message
#data_object, #did, #seq, #type, #type_object
Instance Method Summary collapse
-
#blocks ⇒ Skyfall::CarArchive
Commit data in the form of a parsed CAR archive.
-
#initialize(type_object, data_object) ⇒ SyncMessage
constructor
A new instance of SyncMessage.
- #rev ⇒ Object
Methods inherited from Message
#inspect, new, #operations, #time, #unknown?
Constructor Details
#initialize(type_object, data_object) ⇒ SyncMessage
Returns a new instance of SyncMessage.
26 27 28 29 |
# File 'lib/skyfall/firehose/sync_message.rb', line 26 def initialize(type_object, data_object) super check_if_not_nil 'seq', 'did', 'blocks', 'rev', 'time' end |
Instance Method Details
#blocks ⇒ Skyfall::CarArchive
Returns commit data in the form of a parsed CAR archive.
36 37 38 |
# File 'lib/skyfall/firehose/sync_message.rb', line 36 def blocks @blocks ||= CarArchive.new(@data_object['blocks']) end |
#rev ⇒ Object
31 32 33 |
# File 'lib/skyfall/firehose/sync_message.rb', line 31 def rev @rev ||= @data_object['rev'] end |