fnnode

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2022 License: Apache-2.0, Apache-2.0 Imports: 2 Imported by: 0

README

Golang Fn Node Streaming Framework

2nd attempt at a simple framework to hang functional (or functions) off of and build streaming computation.

Concept: compute a moving average, or variance (complexity theory) of streaming data like stocks, or compute telemetry.


Framework philsophy:

  • Construct a "Node" class that comes with the core, abstracted behaviors.

  • Allow a single Function to be assigned to a "Node" that performs the specialization behavior of that Node -- i.e. compute an average.

    • Inputs are passed in as parameters.
  • The core framework passes information through Channels.

  • The generalized code manages the channels and invokes the specialized function with input, and captures output which is then passed to the output channel. -- Plugin function doesn't handle channels.

  • Each specialized function/Node runs as a spearate goroutine, but is provided as a simple 'func' that takes input in parameters and provides the results as the return value (struct-like) of the function.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FnFactory = FnFactorySt{
	// contains filtered or unexported fields
}
View Source
var SpecFactory = SpecFactorySt{
	// contains filtered or unexported fields
}

Functions

This section is empty.

Types

type Fn

type Fn func(in Msg) (out Msg)

func MakeUnityFn

func MakeUnityFn(spec FnSpec) (Fn, error)

type FnFactorySt

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

func (FnFactorySt) Build

func (fac FnFactorySt) Build(spec FnSpec) (Fn, error)

func (FnFactorySt) Register

func (fac FnFactorySt) Register(id string, proto FnProto) error

type FnProto

type FnProto func(spec FnSpec) (Fn, error)

type FnSpec

type FnSpec interface {
	ID() string
}

func MakeNilSpec

func MakeNilSpec() FnSpec

type Msg

type Msg interface {
	Body() interface{}
}

type NilSpec

type NilSpec struct{}

func (NilSpec) ID

func (spec NilSpec) ID() string

type Node

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

type SpecFactorySt

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

func (SpecFactorySt) Register

func (factory SpecFactorySt) Register(spec FnSpec) error

Jump to

Keyboard shortcuts

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