spanner

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxJobBatchSize = 1000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Spanner

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

func NewSpanner

func NewSpanner(cfg *config.SpannerConfig) (*Spanner, error)

func (*Spanner) BatchAddJobs

func (s *Spanner) BatchAddJobs(ctx context.Context, poolName string, jobs []engine.Job) (err error)

BatchAddJobs write jobs data into secondary storage

func (*Spanner) BatchGetJobsByID

func (s *Spanner) BatchGetJobsByID(ctx context.Context, IDs []string) (jobs []engine.Job, err error)

BatchGetJobsByID returns job data by job ID

func (*Spanner) Close

func (s *Spanner) Close()

func (*Spanner) DelJobs

func (s *Spanner) DelJobs(ctx context.Context, jobIDs []string) (count int64, err error)

DelJobs remove job data from storage based on job id

func (*Spanner) GetQueueSize

func (s *Spanner) GetQueueSize(ctx context.Context, req []*model.DBJobReq) (count map[string]int64, err error)

GetQueueSize returns the size of data in storage which are due before certain due time

func (*Spanner) GetReadyJobs

func (s *Spanner) GetReadyJobs(ctx context.Context, req *model.DBJobReq) (jobs []engine.Job, err error)

GetReadyJobs return jobs which are ready based on input ready time from data storage

Jump to

Keyboard shortcuts

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