tasks

package
v2.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatabaseQueueMonitor

type DatabaseQueueMonitor interface {
	Run(ctx context.Context, b broadcaster.Broadcaster)
	Check(ctx context.Context, permitId uint64, created time.Time, maxAge time.Duration) bool
}

type DatabaseQueueMonitorTask

type DatabaseQueueMonitorTask struct {
	// contains filtered or unexported fields
}

DatabaseQueueMonitorTask a task that monitors queue permit extension notifications. This task also fulfills the `Check` interface method and is used by the `DatabaseQueueSweeperTask` to check for expired permits. This is a persistent task that runs until the provided context is canceled.

func (*DatabaseQueueMonitorTask) Check

func (t *DatabaseQueueMonitorTask) Check(ctx context.Context, permitId uint64, created time.Time, maxAge time.Duration) bool

func (*DatabaseQueueMonitorTask) Run

type DatabaseQueueMonitorTaskConfig

type DatabaseQueueMonitorTaskConfig struct {
	QueueName                 string
	SweepAge                  time.Duration
	QueueStore                dbqueuetypes.QueueStore
	NotifyTypePermitExtension uint8
}

type DatabaseQueueSweeper

type DatabaseQueueSweeper interface {
	Run(ctx context.Context)
}

type DatabaseQueueSweeperTask

type DatabaseQueueSweeperTask struct {
	// contains filtered or unexported fields
}

DatabaseQueueSweeperTask a task that checks existing queue permits and sweeps expired permits. Intended to be called by the task manager of your choice. This is a scheduled task that runs periodically when called by a scheduler.

func (*DatabaseQueueSweeperTask) Run

type DatabaseQueueSweeperTaskConfig

type DatabaseQueueSweeperTaskConfig struct {
	QueueName  string
	QueueStore dbqueuetypes.QueueStore
	SweepFor   time.Duration
	Monitor    DatabaseQueueMonitor
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL