worker

package
v0.11.5 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockWorker

type MockWorker struct {
	mock.Mock
}

MockWorker is a mock of Worker

func NewMockWorker

func NewMockWorker() *MockWorker

NewMockWorker provides a mock function with given fields: workerPool

func (*MockWorker) Start

func (m *MockWorker) Start(ctx context.Context) error

Start provides a mock function to be called

func (*MockWorker) Stop

func (m *MockWorker) Stop()

Stop provides a mock function to be called

type MockWorkerFactory

type MockWorkerFactory struct {
	mock.Mock
}

MockWorkerFactory is a factory for creating workers

func NewMockWorkerFactory

func NewMockWorkerFactory() *MockWorkerFactory

NewMockWorkerFactory returns a new worker factory

func (*MockWorkerFactory) New

func (f *MockWorkerFactory) New(workerPool chan chan scheduler.Jobber) scheduler.Workerer

New returns a new worker constructor

type Worker

type Worker struct {
	WorkerPool chan chan scheduler.Jobber
	JobChannel chan scheduler.Jobber
	// contains filtered or unexported fields
}

Worker defines a worker

func NewWorker

func NewWorker(workerPool chan chan scheduler.Jobber) *Worker

NewWorker creates a new worker

func (*Worker) Start

func (w *Worker) Start(ctx context.Context) error

Start initiates the worker routine

func (*Worker) Stop

func (w *Worker) Stop()

Stop signals the worker to stop listening for work requests.

type WorkerFactory

type WorkerFactory struct{}

WorkerFactory is a factory for creating workers

func NewWorkerFactory

func NewWorkerFactory() *WorkerFactory

NewWorkerFactory returns a new worker factory

func (*WorkerFactory) New

func (f *WorkerFactory) New(workerPool chan chan scheduler.Jobber) scheduler.Workerer

New returns a new worker constructor

Jump to

Keyboard shortcuts

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