workers

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Job

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

K8sJobHandlerFunc is a function for running a k8s job by a k8s worker. type K8sJobHandlerFunc func(context.Context, client.Client, interface{}) K8sJob represents the job to be run by a k8sWorker from the pool.

func NewJob

func NewJob(obj interface{}, handlerFunc func(context.Context, client.Client, interface{})) *Job

NewJob creates a new instance of K8sJob.

type Worker

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

worker within the WorkerPool. runs as a goroutine and invokes Jobs.

type WorkerPool

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

Workpool pool that creates all k8s workers and the assigns k8s jobs to available workers.

func AddWorkerPool

func AddWorkerPool(log logr.Logger, workpoolSize int, manager ctrl.Manager) (*WorkerPool, error)

AddK8sWorkerPool adds k8s workers pool to the manager and returns it.

func (*WorkerPool) Start

func (pool *WorkerPool) Start(ctx context.Context) error

Start function starts the k8s workers pool.

func (*WorkerPool) Submit

func (pool *WorkerPool) Submit(job *Job)

Jump to

Keyboard shortcuts

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