Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BatchConcurrent ¶
func BatchLinear ¶
func SleepWithExponentialBackoff ¶
SleepWithExponentialBackoff sleeps for a duration calculated using exponential backoff and jitter, based on the retry count. The base sleep time and maximum sleep time are provided as inputs. retryCount determines the exponential backoff multiplier.
Types ¶
type OperationPool ¶
type OperationPool struct {
// contains filtered or unexported fields
}
func NewOperationPool ¶
func (*OperationPool) GetOperation ¶
func (p *OperationPool) GetOperation(id string) *SerialOperation
func (*OperationPool) RunOrContinue ¶
func (p *OperationPool) RunOrContinue(id string)
func (*OperationPool) SetTenants ¶
func (p *OperationPool) SetTenants(tenants []*dbsqlc.Tenant)
func (*OperationPool) WithJitter ¶
func (p *OperationPool) WithJitter(maxJitter time.Duration) *OperationPool
type SerialOperation ¶
type SerialOperation struct {
// contains filtered or unexported fields
}
SerialOperation represents a method that can only run serially. It can be configured with a maxJitter duration to add a random delay before executing, which helps prevent the "thundering herd" problem when many operations might start at the same time. The jitter is disabled by default (maxJitter=0) and can be enabled via OperationPool.WithJitter().
func (*SerialOperation) Run ¶
func (o *SerialOperation) Run(ql *zerolog.Logger)
func (*SerialOperation) RunOrContinue ¶
func (o *SerialOperation) RunOrContinue(ql *zerolog.Logger)
Click to show internal directories.
Click to hide internal directories.