package
2.1.0+incompatible
Repository: https://github.com/jexia/semaphore.git
Documentation: pkg.go.dev

# README

Flow manager

Flow managers manage nodes within a given flow. Each node represents an action to be executed (ex: request, rollback). Nodes are executed concurrently from one another. Dependencies are based on references within the given node or if a node dependency is defined. A manager keeps track of all the processes being executed and tracks all the nodes which have been called. If an error is thrown inside one of the processes during the execution of the flow stopped and a rollback initiated.

Branches

Nodes are executed concurrently from one another. When a node is executed a check is performed to check whether the dependencies have been met. Only if all of the dependencies have been met is the node executed.

+------------+
|            |
|    Node    +------------+
|            |            |
+------+-----+            |
       |                  |
       |                  |
+------v-----+     +------v-----+
|            |     |            |
|    Node    |     |    Node    |
|            |     |            |
+------+-----+     +------+-----+
       |                  |
       |                  |
+------v-----+            |
|            |            |
|    Node    <------------+
|            |
+------------+

# Functions

ConstructBranches constructs the node branches based on the made references.
ConstructDependency constructs a dependency for the given node.
ExecuteFunctions executes the given functions and writes the results to the given store.
FetchStarting constructs the starting seeds for the given nodes.
NewCall constructs a new flow caller from the given transport caller and options.
NewCondition constructs a new condition of the given functions stack and specs condition.
NewManager constructs a new manager for the given flow.
NewNode constructs a new node for the given call.
NewNodeOptions constructs a new node options object and collects the options.
NewOnError constructs a new error for the given codec and header manager.
NewProcesses constructs a new processes tracker.
NewTracker constructs a new tracker.
WithCall sets the given call.
WithCondition sets the given condition.
WithFunctions sets the given functions stack.
WithNodeMiddleware sets the given middleware.
WithRollback sets the given call as rollback.

# Variables

ErrAbortFlow represents the error thrown when a flow has to be aborted.

# Structs

CallOptions represents the available options that could be used to construct a new flow caller.
Condition represents a condition which could be evaluated and results in a boolean.
Manager is responsible for the handling of a flow and its steps.
ManagerMiddleware holds the available middleware options for a flow manager.
Node represents a collection of callers and rollbacks which could be executed parallel.
NodeMiddleware holds all the available.
NodeOptions represent a set of options that could be set through option functions.
OnError represents a error codec and metadata manager.
Processes tracks processes.
Request represents a codec and metadata manager.

# Interfaces

Call represents a transport caller implementation.
Expression represents expression that contains the list of parameters and can be evaluated.
Tracker represents a structure responsible of tracking nodes.

# Type aliases

AfterManager is called after a manager is called.
AfterManagerHandler wraps the after call function to allow middleware to be chained.
AfterNode is called after a node is executed.
AfterNodeHandler wraps the after node function to allow middleware to be chained.
BeforeManager is called before a manager get's calles.
BeforeManagerHandler wraps the before call function to allow middleware to be chained.
BeforeNode is called before a node is executed.
BeforeNodeHandler wraps the before node function to allow middleware to be chained.
NodeArguments represents a collection of node options.
NodeOption is a wrapper function.
Nodes represents a node collection.