scheduler

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTask

func AddTask(time UnixTimeSecond, tasks []Task)

func SetDB

func SetDB(d DB)

func SetRunner

func SetRunner(r Runner)

func Start

func Start()

Types

type DB

type DB interface {
	// [start, end)
	AllTasks(ctx context.Context, start, end UnixTimeSecond) DBIterator
	Delete(timestamp UnixTimeSecond)
	AppendTasks(timestamp UnixTimeSecond, tasks []Task)
}

type DBIterator

type DBIterator interface {
	First() bool
	Next() bool

	Release()

	TimeStamp() UnixTimeSecond
	Tasks() []Task
}

type Runner

type Runner interface {
	Run(ctx context.Context, schedulerTime UnixTimeSecond, tasks []Task)
}

type Task

type Task []byte

func MergeTasks

func MergeTasks(ones, others []Task) []Task

type UnixTimeSecond

type UnixTimeSecond uint64

unix 时间戳 unit: s

Jump to

Keyboard shortcuts

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