runner

package
v0.1.44 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2024 License: MIT Imports: 24 Imported by: 0

README

Component Wrapper

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmptyCallback = func(err error) {}

Functions

func UpdateWithConfigurableDefinitions

func UpdateWithConfigurableDefinitions(original []byte, updateWith []byte, configurableDefinitions map[string]*ajson.Node) ([]byte, error)

Types

type Msg

type Msg struct {
	// which edge lead this message, optional
	EdgeID string `json:"edgeID"`
	// which node:port sent message, optional
	From string `json:"from"`
	// recipient of this message in a format node:port
	To string `json:"to"`

	Data []byte `json:"data"`

	Callback func(error) `json:"-"` // to track if msg was rejected
}

Msg being sent via instances edges

type Runner

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

func NewRunner

func NewRunner(name string, flowID string, component m.Component, callbacks ...tracker.Callback) *Runner

func (*Runner) Configure

func (c *Runner) Configure(ctx context.Context, node *v1alpha1.TinyNode, outputCh chan *Msg) error

Configure updates specs and decides do we need to restart which handles by Run method

func (*Runner) Destroy

func (c *Runner) Destroy() error

Destroy stops the instance inclusing emit

func (*Runner) GetStats

func (c *Runner) GetStats() map[string]interface{}

func (*Runner) InitHTTP added in v0.1.43

func (c *Runner) InitHTTP(suggestedPortStr string)

InitHTTP if underlying component is http servicer

func (*Runner) Process

func (c *Runner) Process(ctx context.Context, instanceCh chan *Msg, outputCh chan *Msg) error

Process main instance loop read input port and apply it to the component

func (*Runner) SetLogger

func (c *Runner) SetLogger(l logr.Logger) *Runner

func (*Runner) SetManager added in v0.1.25

func (c *Runner) SetManager(m manager.ResourceInterface) *Runner

func (*Runner) UpdateStatus added in v0.1.43

func (c *Runner) UpdateStatus(status *v1alpha1.TinyNodeStatus) error

ApplyStatus recreates status from scratch

Jump to

Keyboard shortcuts

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