Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue provides a FIFO interface to the datastore for storing cids.
CIDs in the process of being provided when a crash or shutdown occurs may be in the queue when the node is brought back online depending on whether they were fully written to the underlying datastore.
Input to the queue is buffered in memory. The contents of the buffer are written to the datastore when the input buffer contains batchSize items, or when idleWriteTime has elapsed since the previous batch write or dequeue. CIDs to dequeue are read, in order, from the input buffer if there are none in the datastore. Otherwise they are read from the datastore.
If queued items are read from the input buffer before it reaches its limit, then queued items can remain in memory. When the queue is closed, any remaining items in memory are written to the datastore.
func (*Queue) Clear ¶ added in v0.33.1
Clear clears all queued records from memory and the datastore. Returns the number of CIDs removed from the queue.