Documentation ¶
Overview ¶
Package leases coordinates global, singleton activities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Set = wire.NewSet( ProvideLeases, )
Set is used by Wire.
Functions ¶
func ProvideLeases ¶
func ProvideLeases( ctx context.Context, pool *types.StagingPool, stagingDB ident.StagingSchema, ) (types.Leases, error)
ProvideLeases is called by Wire to configure the work-leasing strategy.
This can be removed once stagingDB once SELECT FOR UPDATE uses replicated locks.
Types ¶
type Config ¶
type Config struct { Pool *types.StagingPool // Database access. Target ident.Table // The lease table. // Guard provides a quiescent period between when a lease is // considered to be expired (i.e. a lease callback's context is // canceled) and its published expiration time. This is useful for // situations where it may not be possible to immediately cancel all // side effects of a lease callback (e.g. it makes an external // network request). Guard time.Duration Lifetime time.Duration // Duration of the lease. Poll time.Duration // How often to re-check for an available lease. RetryDelay time.Duration // Delay between re-executing a callback. }
Config is passed to New.
Click to show internal directories.
Click to hide internal directories.