engine

package
v0.0.0-...-21d01d2 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine interface {
	// Start starts the engine with the given context
	Start(ctx context.Context) error

	// Stop stops the engine
	Stop() error
}

Engine represents the behavior of the Nerif Network automation workflow engine

func New

func New(logger logrus.FieldLogger, registry WorkflowRegistry, broadcaster broadcaster.Broadcaster, executor executor.Executor) Engine

New is the constructor of defaultEngine

type WorkflowRegistry

type WorkflowRegistry interface {
	// ListWorkflows returns the list of workflows that are ready to be served.
	// This function is used on the engine startup in order to load workflows for surving.
	ListWorkflows(ctx context.Context) ([]workflow.Workflow, error)

	// StartWorkflow returns a channel to listen for new workflows to start.
	// This function is called on the engine startup in order to start listening for new workflows be to served.
	StartWorkflow() <-chan workflow.Workflow

	// StopWorkflow returns a channel to listen for workflows to stop.
	// This function is called on the engine startup in order to start listening for workflow IDs which should be stopped.
	StopWorkflow() <-chan string
}

WorkflowRegistry represents a behavior of the automation workflow registry

Jump to

Keyboard shortcuts

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