ttlworker

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AttachStatsCollector = func(s sqlexec.SQLExecutor) sqlexec.SQLExecutor {
	return s
}

AttachStatsCollector attaches the stats collector for the session. this function is registered in BootstrapSession in /session/session.go

View Source
var DetachStatsCollector = func(s sqlexec.SQLExecutor) sqlexec.SQLExecutor {
	return s
}

DetachStatsCollector removes the stats collector for the session this function is registered in BootstrapSession in /session/session.go

View Source
var SkipTTLJobManager4Test bool

SkipTTLJobManager4Test skips the bootstrap of TTLJobManager if it's true. It's used to avoid data race in test.

Functions

This section is empty.

Types

type JobManager

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

JobManager schedules and manages the ttl jobs on this instance

func NewJobManager

func NewJobManager(id string, sessPool sessionPool, store kv.Storage) (manager *JobManager)

NewJobManager creates a new ttl job manager

func (*JobManager) CancelJob

func (m *JobManager) CancelJob(ctx context.Context, jobID string) error

CancelJob cancels a job TODO: the delete task is not controlled by the context now (but controlled by the worker context), so cancel doesn't work for delete tasks.

func (*JobManager) Error

func (w *JobManager) Error() error

func (*JobManager) Send

func (w *JobManager) Send() chan<- interface{}

func (*JobManager) Start

func (w *JobManager) Start()

func (*JobManager) Status

func (w *JobManager) Status() workerStatus

func (*JobManager) Stop

func (w *JobManager) Stop()

func (*JobManager) WaitStopped

func (w *JobManager) WaitStopped(ctx context.Context, timeout time.Duration) error

Jump to

Keyboard shortcuts

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