job

package
v0.14.3 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Overview

Package job provides a high-level API to create and schedule a pool of run-ctl and tdaq servers together.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Cfg config.RunCtl

	Timeout time.Duration // timeout for starting the app
	// contains filtered or unexported fields
}

App models a complete tdaq application, with a run-ctl and its flock of tdaq processes.

func New

func New(network string, stdout io.Writer) *App

New creates a new tdaq application.

No process is started nor scheduled yet and the tdaq application configuration can be further customized or modified.

func (*App) Add

func (app *App) Add(ps ...Proc)

Add adds a collection of tdaq processes to the tdaq application.

Add panics if duplicate processes (identified by name) are added.

func (*App) Do

func (app *App) Do(ctx context.Context, cmd tdaq.CmdType) error

Do sends the given command to the underlying run-ctl.

func (*App) Start

func (app *App) Start() error

Start starts the whole tdaq application. Start first starts the run-ctl and then all the tdaq processes. Start waits for all the tdaq processes to be correctly connected to the run-ctl (or bails out if the timeout is reached) before returning an error if any.

func (*App) Wait

func (app *App) Wait() error

Wait waits for the run-ctl to shut down.

type CmdHandlers

type CmdHandlers map[string]tdaq.CmdHandler

CmdHandlers is a map of tdaq command handlers.

type InputHandlers

type InputHandlers map[string]tdaq.InputHandler

InputHandlers is a map of tdaq input handlers.

type OutputHandlers

type OutputHandlers map[string]tdaq.OutputHandler

OutputHandlers is a map of tdaq output handlers.

type Proc

type Proc struct {
	Dev      interface{} // tdaq device value
	Name     string      // name of the process
	Level    log.Level
	Cmds     CmdHandlers    // command handlers
	Inputs   InputHandlers  // input handlers
	Outputs  OutputHandlers // output handlers
	Handlers RunHandlers    // run-handlers
}

Proc describes a tdaq process.

type RunHandlers

type RunHandlers []tdaq.RunHandler

RunHandlers is a collection of tdaq run handlers.

Jump to

Keyboard shortcuts

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