Documentation ¶
Overview ¶
package batchDeleter provides a wrapper around the db.Pruner to provide a way to get expired records at a given interval and delete them at a separate given interval.
Index ¶
Constants ¶
const (
DeletingQueueDepth = "deleting_queue_depth"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BatchDeleter ¶
type BatchDeleter struct {
// contains filtered or unexported fields
}
BatchDeleter manages getting records that have expired and then deleting them.
func NewBatchDeleter ¶
func NewBatchDeleter(config Config, logger log.Logger, metricsRegistry provider.Provider, pruner db.Pruner) (*BatchDeleter, error)
NewBatchDeleter creates a BatchDeleter with the given values, ensuring that the configuration and other values given are valid. If configuration values aren't valid, a default value is used.
func (*BatchDeleter) Start ¶
func (d *BatchDeleter) Start()
Start starts the batcher, which includes a ticker for getting expired records at an interval and the workers that do the deleting.
func (*BatchDeleter) Stop ¶
func (d *BatchDeleter) Stop()
Stop closes the internal queue and waits for the workers to finish processing what has already been added. This can block as it waits for everything to stop.