actionreconcilers

package
v0.0.0-...-75739c8 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateChildRelationships

func CreateChildRelationships(actions []base.ActionStructure) ([]base.ActionStructure, error)

CreateChildRelationships establishes the relationship hierarchy between any actions that are dependent on others.

func Init

func Init() map[string]ActionReconciler

Init adds the reconcilers to the reconcilerMap.

func StandardReconcile

func StandardReconcile(device string, inCount int, actions []base.ActionStructure) ([]base.ActionStructure, int, error)

StandardReconcile determines the set of compatible actions, and then sorts them by device and priority.

Types

type ActionReconciler

type ActionReconciler interface {
	/*
	   Reconcile takes a slice of ActionStructure objects, and returns a slice of
	   slices representing a DAG representing execution order, e.g. each outer slice
	   represents a level in the DAG

	   It is the purpose of the reconcile function to allow control of the interplay of
	   commands within a room (order of execution, mutually exclusive commands, etc.)

	   The ActionStructure elements will be evaluated (executed) in the order returned
	   from Reconcile.
	*/
	Reconcile([]base.ActionStructure, int) ([]base.ActionStructure, int, error)
}

ActionReconciler is an interface that builds a reconciler for a room configuration. The purpose of a reconciler is to sort by device and priority.

type DefaultReconciler

type DefaultReconciler struct{}

DefaultReconciler is the Default Reconciler Sorts by device, then by priority

func (*DefaultReconciler) Reconcile

func (d *DefaultReconciler) Reconcile(actions []base.ActionStructure, inCount int) ([]base.ActionStructure, int, error)

Reconcile sorts through the list of actions to determine the execution order.

Jump to

Keyboard shortcuts

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