Documentation
¶
Index ¶
Constants ¶
View Source
const ( // LockOwner the contant to specify the name of the lock owner in the context LockOwner string = "lock_owner" )
Variables ¶
This section is empty.
Functions ¶
func GetLockOwner ¶
GetLockOwner return the owner to use when acquiring a lock. returns empty string if the given context did not contain any *string* value for the `lock_owner` key.
Types ¶
type BaseWorker ¶
type BaseWorker struct { Ctx context.Context App application.Application Name string // name of the lock (eg: "user_deactivation_notification"), to use when claiming a lock Owner string // owner of the lock (eg, the name of the Pod), to use when claiming a lock Do func() // the function to run the business code at each cycle of the worker Opts []pglock.ClientOption // contains filtered or unexported fields }
BaseWorker the base worker
func (*BaseWorker) IsStopped ¶
func (w *BaseWorker) IsStopped() bool
IsStopped return true if the worker is not in a `running` state, false otherwise.
func (*BaseWorker) Start ¶
func (w *BaseWorker) Start(freq time.Duration)
Start starts the worker with the given timer
Click to show internal directories.
Click to hide internal directories.