tasks

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2019 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAlreadyStopped = errors.New("task already has stopped")
)

Functions

This section is empty.

Types

type ExeOption

type ExeOption func(exe *PeriodicExecutor)

func ExecutorWithGoroutinesCount

func ExecutorWithGoroutinesCount(count int) ExeOption

func ExecutorWithInitialTimeout

func ExecutorWithInitialTimeout(initialTimeout time.Duration) ExeOption

type PeriodicExecutor

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

func NewPeriodicExecutor

func NewPeriodicExecutor(timeout time.Duration, opts ...ExeOption) *PeriodicExecutor

func (*PeriodicExecutor) SetSchedulerTimeout

func (pe *PeriodicExecutor) SetSchedulerTimeout(duration time.Duration) *PeriodicExecutor

func (*PeriodicExecutor) StartTask

func (pe *PeriodicExecutor) StartTask(function func() bool) *PeriodicExecutor

func (*PeriodicExecutor) StopTask

func (pe *PeriodicExecutor) StopTask()

type Queue

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

func NewInMemoryQueue

func NewInMemoryQueue(concurrentConsumers, queueSize int) *Queue

func (*Queue) Close

func (q *Queue) Close()

func (*Queue) Offer

func (q *Queue) Offer(value interface{})

func (*Queue) StartConsuming

func (q *Queue) StartConsuming(f func(value interface{}))

func (*Queue) Take

func (q *Queue) Take() (interface{}, bool)

Jump to

Keyboard shortcuts

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