executor

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterBuiltinNodeTypes

func RegisterBuiltinNodeTypes()

RegisterBuiltinNodeTypes initializes the node registry with all built-in node types

func RegisterBuiltinSourceTypes

func RegisterBuiltinSourceTypes()

RegisterBuiltinSourceTypes initializes the node registry with all built-in source types

Types

type Executor

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

Executor is the main processing engine in firebolt. It starts your data `source`, and pipes the data from that source through the configured processing `nodes`. The executor is responsible for _managing_ the source and the nodes, the nodes are responsible for _performing_ the application's data processing stages.

func New

func New(opts ...Opt) (*Executor, error)

New instantiates the firebolt executor based on the passed functional options.

func (*Executor) Execute

func (e *Executor) Execute()

Execute starts processing based on your application's source and node configuration. This call will block forever while the application runs, unless an unrecoverable error is encountered or the source exits.

func (*Executor) FindNodeByID

func (e *Executor) FindNodeByID(id string) *node.Context

FindNodeByID finds the node with the specified ID, or returns 'nil' if no node is configured with that ID.

func (*Executor) GetSource

func (e *Executor) GetSource() *node.Source

GetSource returns the source configured for this firebolt application.

func (*Executor) InitMessaging

func (e *Executor) InitMessaging(c config.Config) error

InitMessaging should set up the configured messaging transport, and it MUST ensure that the executor's fbcontext is set, but it MUST NOT actually start receiving messages

func (*Executor) SendMessage

func (e *Executor) SendMessage(msg message.Message) error

SendMessage broadcasts the passed message to all nodes that are subscribed to the MessageType.

func (*Executor) Shutdown

func (e *Executor) Shutdown() (done chan struct{})

Shutdown stops the source and allows the nodes to finish processing before the Execute() call returns

func (*Executor) StartMessaging

func (e *Executor) StartMessaging()

StartMessaging runs the message receiver and blocks until any pending / non-ack'd messages have been processed.

type NoOpMessageReceiver

type NoOpMessageReceiver struct {
}

NoOpMessageReceiver is a message receiver that does, well, nothing

func (*NoOpMessageReceiver) Initialized

func (n *NoOpMessageReceiver) Initialized() bool

Initialized is a no-op

func (*NoOpMessageReceiver) SetNotificationFunc

func (n *NoOpMessageReceiver) SetNotificationFunc(notifier message.NotificationFunc)

SetNotificationFunc is a no-op

func (*NoOpMessageReceiver) Shutdown

func (n *NoOpMessageReceiver) Shutdown()

Shutdown is a no-op

func (*NoOpMessageReceiver) Start

func (n *NoOpMessageReceiver) Start()

Start is a no-op

type Opt

type Opt func(*Executor) (*Executor, error)

Opt is an option type that can be passed to New to tell it how to set up the returned *Executor

func WithConfig

func WithConfig(c config.Config) Opt

WithConfig is an Opt that sets up an Executor with c

func WithConfigFile

func WithConfigFile(path string) Opt

WithConfigFile is an option type that parses a config file and sets up an Executor with the file.

Jump to

Keyboard shortcuts

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