runner

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2022 License: MIT Imports: 3 Imported by: 0

README

runner

Runner is a "container" to run long running processes concurrently

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Runnable

type Runnable interface {
	Run(ctx context.Context) error
}

Runnable is the application interface, an object implementing this interface should follow the context protocol

type Runner

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

Runner is a parent app for apps to be run

func NewRunner

func NewRunner(apps ...Runnable) *Runner

NewRunner returns *Runner

func (*Runner) Add

func (r *Runner) Add(app Runnable) *Runner

Add adds the Runnable into collection of Apps to be run and is not thread safe

func (*Runner) Run

func (r *Runner) Run(ctx context.Context) error

Run runs apps passed to the constructor concurrently, if one of them fails all the other running apps will be terminated by canceling context passed into their Run method

Jump to

Keyboard shortcuts

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