worker_watcher

package
v2.0.2-beta.2 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Watcher

type Watcher interface {
	// Watch used to add workers to the container
	Watch(workers []worker.BaseProcess) error

	// Get provide first free worker
	Get(ctx context.Context) (worker.BaseProcess, error)

	// Push enqueues worker back
	Push(w worker.BaseProcess)

	// Allocate - allocates new worker and put it into the WorkerWatcher
	Allocate() error

	// Destroy destroys the underlying container
	Destroy(ctx context.Context)

	// WorkersList return all container w/o removing it from internal storage
	List() []worker.BaseProcess

	// RemoveWorker remove worker from the container
	Remove(wb worker.BaseProcess)
}

Watcher is an interface for the Sync workers lifecycle

func NewSyncWorkerWatcher

func NewSyncWorkerWatcher(allocator worker.Allocator, numWorkers uint64, events events.Handler) Watcher

workerCreateFunc can be nil, but in that case, dead container will not be replaced

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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