github.com/koko1123/flow-go-1@v0.29.6/storage/consumer_progress.go (about)

     1  package storage
     2  
     3  // ConsumerProgress reads and writes the last processed index of the job in the job queue
     4  type ConsumerProgress interface {
     5  	// read the current processed index
     6  	ProcessedIndex() (uint64, error)
     7  	// insert the default processed index to the storage layer, can only be done once.
     8  	// initialize for the second time will return storage.ErrAlreadyExists
     9  	InitProcessedIndex(defaultIndex uint64) error
    10  	// update the processed index in the storage layer.
    11  	// it will fail if InitProcessedIndex was never called.
    12  	SetProcessedIndex(processed uint64) error
    13  }