workflowsupport

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProcessAsync

func ProcessAsync[T any, U any](inputs []U, block func(u U) (T, error)) []T

Types

type WorkFinder

type WorkFinder interface {
	FindRequested() []interface{}
	MarkCompleted()
	MarkErroneous()
	Stop()
}

type WorkScheduler

type WorkScheduler struct {
	Finder  interface{}
	Workers []Worker
	Delay   int64
	// contains filtered or unexported fields
}

func NewScheduler

func NewScheduler(finder interface{}, workers []Worker, delay int64) WorkScheduler

func (*WorkScheduler) Start

func (ws *WorkScheduler) Start()

func (*WorkScheduler) Stop

func (ws *WorkScheduler) Stop()

type Worker

type Worker interface {
	Run(interface{}) error
}

Jump to

Keyboard shortcuts

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