Documentation ¶
Overview ¶
Package runtime implements environment for dataflow programs execution.
Index ¶
- Variables
- type BoolMsg
- type Connection
- type ConnectionMeta
- type Connector
- type EmptyListener
- type Event
- type EventListener
- type EventMessagePending
- type EventMessageReceived
- type EventMessageSent
- type EventType
- type FloatMsg
- type FuncCall
- type FuncCreator
- type FuncIO
- type FuncPorts
- type FuncRunner
- type IntMsg
- type ListMsg
- type MapMsg
- type Msg
- type MsgType
- type PortAddr
- type Ports
- type Program
- type Runtime
- type StrMsg
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrStartPortNotFound = errors.New("enter port not found") ErrExitPortNotFound = errors.New("exit port not found") ErrConnector = errors.New("connector") ErrFuncRunner = errors.New("func runner") )
View Source
var ErrNilDeps = errors.New("runtime deps nil")
View Source
var ErrSinglePortCount = errors.New("number of ports found by name not equals to one")
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct { Sender chan Msg Receivers []chan Msg Meta ConnectionMeta }
type ConnectionMeta ¶
type Connector ¶
type Connector struct {
// contains filtered or unexported fields
}
func NewConnector ¶ added in v0.6.3
func NewConnector(lis EventListener) Connector
func NewDefaultConnector ¶
func NewDefaultConnector() Connector
type EmptyListener ¶
type EmptyListener struct{}
type Event ¶
type Event struct { Type EventType MessageSent *EventMessageSent MessagePending *EventMessagePending MessageReceived *EventMessageReceived }
type EventListener ¶
type EventMessagePending ¶
type EventMessagePending struct { Meta ConnectionMeta // We can use sender from here and receivers just as a handy metadata ReceiverPortAddr PortAddr // So what we really need is sender and receiver port addrs }
func (EventMessagePending) String ¶
func (e EventMessagePending) String() string
type EventMessageReceived ¶
type EventMessageReceived struct { Meta ConnectionMeta // Same as with pending event ReceiverPortAddr PortAddr }
func (EventMessageReceived) String ¶
func (e EventMessageReceived) String() string
type EventMessageSent ¶
type EventMessageSent struct { SenderPortAddr PortAddr ReceiverPortAddrs map[PortAddr]struct{} // We use map to work with breakpoints }
func (EventMessageSent) String ¶
func (e EventMessageSent) String() string
type FloatMsg ¶
type FloatMsg struct {
// contains filtered or unexported fields
}
func NewFloatMsg ¶
type FuncCreator ¶
type FuncPorts ¶
FuncPorts is data structure that runtime functions must use at startup to get needed ports. Its methods can return error because it's okay to fail at startup. Keys are port names and values are slots.
type FuncRunner ¶
type FuncRunner struct {
// contains filtered or unexported fields
}
func MustNewFuncRunner ¶
func MustNewFuncRunner(registry map[string]FuncCreator) FuncRunner
type ListMsg ¶
type ListMsg struct {
// contains filtered or unexported fields
}
List
func NewListMsg ¶
type Msg ¶
type Msg interface { fmt.Stringer Type() MsgType Bool() bool Int() int64 Float() float64 Str() string List() []Msg Map() map[string]Msg }
Msg methods don't return errors because they can be used not only at startup. If runtime functions need to validate message at startup, they must do it by themselves.
type PortAddr ¶
type Program ¶
type Program struct { Ports Ports Connections []Connection Funcs []FuncCall }
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
func New ¶
func New(connector Connector, funcRunner FuncRunner) Runtime
Source Files ¶
Click to show internal directories.
Click to hide internal directories.