Documentation ¶
Overview ¶
package workflows exposes the workflow engine itself as a function environment to improve recursion.
Although other runtimes could also be used to proxy calls to the workflow engine, that would be an unnecessarily expensive operation. The call would pass from the workflow engine to the function environment back to the workflow engine. Shortcutting this round-trip by avoiding leaving the workflow engine, reduces the critical path of the call.
Besides the performance, recursive workflow calls happen in the context of a higher-level workflow. To avoid confusing users and cluttering external (logging) systems, this package enables these workflows to remain largely opaque to the user.
Index ¶
Constants ¶
const ( PollInterval = time.Duration(100) * time.Millisecond Name = "workflows" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
Runtime provides an abstraction of the workflow engine itself to use as a Task runtime environment.
func NewRuntime ¶
func NewRuntime(api *api.Invocation, invocations *store.Invocations, workflows *store.Workflows) *Runtime
func (*Runtime) Invoke ¶
func (rt *Runtime) Invoke(spec *types.TaskInvocationSpec, opts ...fnenv.InvokeOption) (*types.TaskInvocationStatus, error)
func (*Runtime) InvokeWorkflow ¶
func (rt *Runtime) InvokeWorkflow(spec *types.WorkflowInvocationSpec, opts ...fnenv.InvokeOption) (*types.WorkflowInvocation, error)