job

package
v0.0.0-...-9d48049 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: Unlicense Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FeedService

type FeedService interface {
	ListFeeds() ([]*feed.Feed, error)
	FetchItems(feedID int) ([]*item.Item, error)
}

type ItemService

type ItemService interface {
	UpsertItems(command *item.UpsertItemsCommand) error
}

type ItemsJob

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

func NewItemsJob

func NewItemsJob(feedService FeedService, itemService ItemService) *ItemsJob

func (*ItemsJob) Execute

func (j *ItemsJob) Execute()

type Job

type Job interface {
	Execute()
}

type Scheduler

type Scheduler struct {
	Queue    chan Job
	Interval time.Duration
}

func NewScheduler

func NewScheduler(interval time.Duration) *Scheduler

func (*Scheduler) ScheduleOnce

func (s *Scheduler) ScheduleOnce(duration time.Duration, job Job)

func (*Scheduler) Start

func (s *Scheduler) Start()

Jump to

Keyboard shortcuts

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