Documentation
¶
Overview ¶
Package device_flowgraph runs the Flowgraph nodes placed on this Device.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ForgeWorkerWatch ¶
type ForgeWorkerWatch struct {
// contains filtered or unexported fields
}
ForgeWorkerWatch holds the Forge Worker declaration of the accepted forge-worker node and the key of the Device that hosts it. The Reconciler sets it; the plugin host reads it. Each change to either value is a new revision.
func NewForgeWorkerWatch ¶
func NewForgeWorkerWatch() *ForgeWorkerWatch
NewForgeWorkerWatch constructs a ForgeWorkerWatch declaring no Worker.
func (*ForgeWorkerWatch) Set ¶
func (w *ForgeWorkerWatch) Set(deviceKey string, declaration *s4wave_device.ForgeWorkerDeclaration)
Set replaces the Device key and declaration, and wakes the watchers when either changed. A nil declaration declares no Worker.
func (*ForgeWorkerWatch) WaitForgeWorker ¶
func (w *ForgeWorkerWatch) WaitForgeWorker(ctx context.Context, last uint64) ([]byte, string, uint64, error)
WaitForgeWorker returns the encoded declaration, the Device key and the revision once the revision differs from last. A zero last returns the current value at once. The declaration is empty while no Worker is declared.
type Reconciler ¶
type Reconciler struct {
// contains filtered or unexported fields
}
Reconciler runs the Flowgraph nodes placed on one Device. It watches the World state each pass read and the DevicePolicy for the allowed node types, compiles each allowed node through its node type, applies the compiled entries as one ConfigSet on the Device Session's bus, and writes each node's state into the Device object. A node that fails shows as rejected with its error while the other nodes keep running. The daemon is the only writer of the Device object.
func NewReconciler ¶
func NewReconciler( le *logrus.Entry, b bus.Bus, engine world.Engine, policy *device_policy.PolicyStore, forgeWorker *ForgeWorkerWatch, deviceKey, peerID string, hold func() func(), ) *Reconciler
NewReconciler constructs a Reconciler for the Device at deviceKey with the given peer ID. It calls hold while a node runs and calls the release it returns once none do.