Class: Kcl::Workers::RecordCheckpointer
- Inherits:
-
Object
- Object
- Kcl::Workers::RecordCheckpointer
- Defined in:
- lib/kcl/workers/record_checkpointer.rb
Instance Method Summary collapse
-
#initialize(shard, checkpointer) ⇒ RecordCheckpointer
constructor
A new instance of RecordCheckpointer.
- #update_checkpoint(sequence_number) ⇒ Object
Constructor Details
#initialize(shard, checkpointer) ⇒ RecordCheckpointer
Returns a new instance of RecordCheckpointer.
3 4 5 6 |
# File 'lib/kcl/workers/record_checkpointer.rb', line 3 def initialize(shard, checkpointer) @shard = shard @checkpointer = checkpointer end |
Instance Method Details
#update_checkpoint(sequence_number) ⇒ Object
8 9 10 11 12 |
# File 'lib/kcl/workers/record_checkpointer.rb', line 8 def update_checkpoint(sequence_number) # checkpoint the last sequence of a closed shard @shard.checkpoint = sequence_number || Kcl::Checkpoints::Sentinel::SHARD_END @checkpointer.update_checkpoint(@shard) end |