worker_watcher

package
v3.0.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WorkerWatcher

type WorkerWatcher struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewSyncWorkerWatcher

func NewSyncWorkerWatcher(allocator pool.Allocator, log *zap.Logger, numWorkers uint64, allocateTimeout time.Duration) *WorkerWatcher

NewSyncWorkerWatcher is a constructor for the Watcher

func (*WorkerWatcher) Allocate

func (ww *WorkerWatcher) Allocate() error

func (*WorkerWatcher) Destroy

func (ww *WorkerWatcher) Destroy(ctx context.Context)

Destroy all underlying container (but let them complete the task)

func (*WorkerWatcher) List

func (ww *WorkerWatcher) List() []*worker.Process

List - this is O(n) operation, and it will return copy of the actual workers

func (*WorkerWatcher) Release

func (ww *WorkerWatcher) Release(w *worker.Process)

Release O(1) operation

func (*WorkerWatcher) Remove

func (ww *WorkerWatcher) Remove(wb *worker.Process)

Remove worker

func (*WorkerWatcher) Reset

func (ww *WorkerWatcher) Reset(ctx context.Context)

func (*WorkerWatcher) Take

func (ww *WorkerWatcher) Take(ctx context.Context) (*worker.Process, error)

Take is not a thread safe operation

func (*WorkerWatcher) Watch

func (ww *WorkerWatcher) Watch(workers []*worker.Process) error

Directories

Path Synopsis
container

Jump to

Keyboard shortcuts

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