longrunningprovider

package
v0.0.0-...-0117b6e Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Overview

Package longrunningprovider provides an interface to start/stop a worker process for long-running tasks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IContainer

type IContainer interface {
	Start()
	Monitor()
	Stop(reboot.StopType)
}

IContainer is the interface for starting/terminating/watching worker

type WorkerContainer

type WorkerContainer struct {
	sync.Mutex
	// contains filtered or unexported fields
}

WorkerContainers contains list of running workers, it starts/terminates/watches workers

func NewWorkerContainer

func NewWorkerContainer(
	context context.ICoreAgentContext,
	messageBus messagebus.IMessageBus) *WorkerContainer

NewWorkerContainer returns worker container

func (*WorkerContainer) Monitor

func (container *WorkerContainer) Monitor()

Monitor watches worker process, restarts the worker when receive worker exist signal

func (*WorkerContainer) Start

func (container *WorkerContainer) Start()

Start identifies and loads the worker configs and starts long running workers

func (*WorkerContainer) Stop

func (container *WorkerContainer) Stop(stopType reboot.StopType)

Stop stops monitor and stop all the running workers

Directories

Path Synopsis
Package datastore provides interface to read and write json data from/to disk
Package datastore provides interface to read and write json data from/to disk
filesystem
Package filesystem contains related functions from os, io, and io/ioutil packages
Package filesystem contains related functions from os, io, and io/ioutil packages
Package discover finds worker configs for the core agent.
Package discover finds worker configs for the core agent.
Package model contains data objects for long running container
Package model contains data objects for long running container
Package provider implements logic for allowing interaction with worker processes
Package provider implements logic for allowing interaction with worker processes

Jump to

Keyboard shortcuts

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