worker

package
v0.0.0-...-4058e4e Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2023 License: Unlicense Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Polling

type Polling func(ctx context.Context, idx int32) error

type PoolConfig

type PoolConfig struct {
	NumProcess     int32
	NumPolling     int32
	PollingBackoff time.Duration
}

type Process

type Process func(ctx context.Context, message interface{}) error

type Worker

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

func New

func New(logger *logger.Logger, config *PoolConfig) (*Worker, error)

func (*Worker) SendJob

func (w *Worker) SendJob(ctx context.Context, message interface{})

func (*Worker) Start

func (w *Worker) Start() error

func (*Worker) Stop

func (w *Worker) Stop()

func (*Worker) WithPolling

func (w *Worker) WithPolling(polling Polling) *Worker

func (*Worker) WithProcess

func (w *Worker) WithProcess(process Process) *Worker

Jump to

Keyboard shortcuts

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