pagesche

package
v1.1.0-beta Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ScheduleAwaken

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

func (ScheduleAwaken) Spec

func (awaken ScheduleAwaken) Spec() schedule.Schedule

type ScheduleData

type ScheduleData struct {
	Timestamp Timestamp         `bson:"timestamp"`
	Spec      schedule.Schedule `bson:"spec"`
}

type ScheduleStore

type ScheduleStore interface {
	GetPageSchedule(ctx context.Context, fromTimeMs Timestamp, toTimeMs Timestamp) ([]ScheduleData, error)
	SaveSchedule(ctx context.Context, s schedule.Schedule) (ScheduleData, error)
	MarkMillionSeconds(ctx context.Context, timestamp Timestamp) error
	GetMarkMillionSeconds(ctx context.Context) (timestamp Timestamp, err error)
}

type Scheduler

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

func NewScheduler

func NewScheduler(timeWheel *timewheel.TimeWheel, store ScheduleStore, pageInterval int64) *Scheduler

func (*Scheduler) CloseWithContext

func (s *Scheduler) CloseWithContext(ctx context.Context) error

func (*Scheduler) Commit

func (s *Scheduler) Commit(ctx context.Context, err error)

not call in parallel

func (*Scheduler) PostSchedule

func (s *Scheduler) PostSchedule(ctx context.Context, schedule schedule.Schedule) error

if schedule over max time wheel. Return ErrOverMaxDuration

func (*Scheduler) WaitAwaken

func (s *Scheduler) WaitAwaken(ctx context.Context) (schedule.Awaken, error)

not call in parallel

type Timestamp

type Timestamp struct {
	MillionSeconds int64
	Index          int32
}

func (Timestamp) Less

func (ts Timestamp) Less(timestamp Timestamp) bool

Jump to

Keyboard shortcuts

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