github.com/koko1123/flow-go-1@v0.29.6/engine/verification/fetcher/processor.go (about) 1 package fetcher 2 3 import ( 4 "github.com/koko1123/flow-go-1/model/chunks" 5 "github.com/koko1123/flow-go-1/module" 6 ) 7 8 // AssignedChunkProcessor should be implemented by the verification node engine responsible 9 // for processing assigned chunk locators to this node. 10 // 11 // In the current version, the fetcher engine is responsible of processing the assigned chunk locators. 12 // From the architectural perspective, AssignedChunkProcessor aligns as following on the verification pipeline: 13 // ---------------- ------------------ --------------------------- 14 // | Chunk Queue | ---> assigned chunk locators --> | Chunk Consumer | ---> chunk workers --> | Assigned Chunk Processor| 15 // ---------------- ------------------ --------------------------- 16 type AssignedChunkProcessor interface { 17 module.ReadyDoneAware 18 // ProcessAssignedChunk receives an assigned chunk locator and processes its corresponding chunk. 19 // A chunk processor is expected to shape a verifiable chunk out of the assigned chunk, and pass it to 20 // the verifier Engine. 21 // Note: it should be implemented in a non-blocking way. 22 ProcessAssignedChunk(locator *chunks.Locator) 23 24 // WithChunkConsumerNotifier sets the notifier of this chunk processor. 25 // The notifier is called by the internal logic of the processor to let the consumer know that 26 // the processor is done by processing a chunk so that the next chunk may be passed to the processor 27 // by the consumer through invoking ProcessAssignedChunk of this processor. 28 WithChunkConsumerNotifier(notifier module.ProcessingNotifier) 29 }