scheduler

package
v0.0.0-...-b9a8969 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package scheduler implements the application internal scheduler.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFeedScheduler

func NewFeedScheduler(store *storage.Storage, workerPool *WorkerPool, frequency, batchSize int)

NewFeedScheduler starts a new scheduler that push jobs to a pool of workers.

func NewSessionScheduler

func NewSessionScheduler(store *storage.Storage, frequency int)

NewSessionScheduler starts a new scheduler that clean old sessions.

Types

type Worker

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

Worker refreshes a feed in the background.

func (*Worker) Run

func (w *Worker) Run(c chan model.Job)

Run wait for a job and refresh the given feed.

type WorkerPool

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

WorkerPool handle a pool of workers.

func NewWorkerPool

func NewWorkerPool(feedHandler *feed.Handler, nbWorkers int) *WorkerPool

NewWorkerPool creates a pool of background workers.

func (*WorkerPool) Push

func (w *WorkerPool) Push(jobs model.JobList)

Push send a list of jobs to the queue.

Jump to

Keyboard shortcuts

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