Documentation
¶
Index ¶
- Constants
- Variables
- type ActivityTask
- type Backend
- type BackendOption
- func WithActivityLockTimeout(timeout time.Duration) BackendOption
- func WithContextPropagator(prop workflow.ContextPropagator) BackendOption
- func WithConverter(converter converter.Converter) BackendOption
- func WithLogger(logger *slog.Logger) BackendOption
- func WithMaxHistorySize(size int64) BackendOption
- func WithMetrics(client metrics.Client) BackendOption
- func WithRemoveContinuedAsNewInstances() BackendOption
- func WithStickyTimeout(timeout time.Duration) BackendOption
- func WithTracerProvider(tp trace.TracerProvider) BackendOption
- func WithWorkerName(workerName string) BackendOption
- func WithWorkflowLockTimeout(timeout time.Duration) BackendOption
- type ErrNotSupported
- type Feature
- type MockBackend
- func (_mock *MockBackend) CancelWorkflowInstance(ctx context.Context, instance *workflow.Instance, cancelEvent *history.Event) error
- func (_mock *MockBackend) Close() error
- func (_mock *MockBackend) CompleteActivityTask(ctx context.Context, task *ActivityTask, result *history.Event) error
- func (_mock *MockBackend) CompleteWorkflowTask(ctx context.Context, task *WorkflowTask, state core.WorkflowInstanceState, ...) error
- func (_mock *MockBackend) CreateWorkflowInstance(ctx context.Context, instance *workflow.Instance, event *history.Event) error
- func (_m *MockBackend) EXPECT() *MockBackend_Expecter
- func (_mock *MockBackend) ExtendActivityTask(ctx context.Context, task *ActivityTask) error
- func (_mock *MockBackend) ExtendWorkflowTask(ctx context.Context, task *WorkflowTask) error
- func (_mock *MockBackend) FeatureSupported(feature Feature) bool
- func (_mock *MockBackend) GetActivityTask(ctx context.Context, queues []workflow.Queue) (*ActivityTask, error)
- func (_mock *MockBackend) GetStats(ctx context.Context) (*Stats, error)
- func (_mock *MockBackend) GetWorkflowInstanceHistory(ctx context.Context, instance *workflow.Instance, lastSequenceID *int64) ([]*history.Event, error)
- func (_mock *MockBackend) GetWorkflowInstanceState(ctx context.Context, instance *workflow.Instance) (core.WorkflowInstanceState, error)
- func (_mock *MockBackend) GetWorkflowTask(ctx context.Context, queues []workflow.Queue) (*WorkflowTask, error)
- func (_mock *MockBackend) Metrics() metrics.Client
- func (_mock *MockBackend) Options() *Options
- func (_mock *MockBackend) PrepareActivityQueues(ctx context.Context, queues []workflow.Queue) error
- func (_mock *MockBackend) PrepareWorkflowQueues(ctx context.Context, queues []workflow.Queue) error
- func (_mock *MockBackend) RemoveWorkflowInstance(ctx context.Context, instance *workflow.Instance) error
- func (_mock *MockBackend) RemoveWorkflowInstances(ctx context.Context, options ...RemovalOption) error
- func (_mock *MockBackend) SignalWorkflow(ctx context.Context, instanceID string, event *history.Event) error
- func (_mock *MockBackend) Tracer() trace.Tracer
- type MockBackend_CancelWorkflowInstance_Call
- func (_c *MockBackend_CancelWorkflowInstance_Call) Return(err error) *MockBackend_CancelWorkflowInstance_Call
- func (_c *MockBackend_CancelWorkflowInstance_Call) Run(...) *MockBackend_CancelWorkflowInstance_Call
- func (_c *MockBackend_CancelWorkflowInstance_Call) RunAndReturn(...) *MockBackend_CancelWorkflowInstance_Call
- type MockBackend_Close_Call
- type MockBackend_CompleteActivityTask_Call
- func (_c *MockBackend_CompleteActivityTask_Call) Return(err error) *MockBackend_CompleteActivityTask_Call
- func (_c *MockBackend_CompleteActivityTask_Call) Run(run func(ctx context.Context, task *ActivityTask, result *history.Event)) *MockBackend_CompleteActivityTask_Call
- func (_c *MockBackend_CompleteActivityTask_Call) RunAndReturn(run func(ctx context.Context, task *ActivityTask, result *history.Event) error) *MockBackend_CompleteActivityTask_Call
- type MockBackend_CompleteWorkflowTask_Call
- func (_c *MockBackend_CompleteWorkflowTask_Call) Return(err error) *MockBackend_CompleteWorkflowTask_Call
- func (_c *MockBackend_CompleteWorkflowTask_Call) Run(...) *MockBackend_CompleteWorkflowTask_Call
- func (_c *MockBackend_CompleteWorkflowTask_Call) RunAndReturn(...) *MockBackend_CompleteWorkflowTask_Call
- type MockBackend_CreateWorkflowInstance_Call
- func (_c *MockBackend_CreateWorkflowInstance_Call) Return(err error) *MockBackend_CreateWorkflowInstance_Call
- func (_c *MockBackend_CreateWorkflowInstance_Call) Run(...) *MockBackend_CreateWorkflowInstance_Call
- func (_c *MockBackend_CreateWorkflowInstance_Call) RunAndReturn(...) *MockBackend_CreateWorkflowInstance_Call
- type MockBackend_Expecter
- func (_e *MockBackend_Expecter) CancelWorkflowInstance(ctx interface{}, instance interface{}, cancelEvent interface{}) *MockBackend_CancelWorkflowInstance_Call
- func (_e *MockBackend_Expecter) Close() *MockBackend_Close_Call
- func (_e *MockBackend_Expecter) CompleteActivityTask(ctx interface{}, task interface{}, result interface{}) *MockBackend_CompleteActivityTask_Call
- func (_e *MockBackend_Expecter) CompleteWorkflowTask(ctx interface{}, task interface{}, state interface{}, ...) *MockBackend_CompleteWorkflowTask_Call
- func (_e *MockBackend_Expecter) CreateWorkflowInstance(ctx interface{}, instance interface{}, event interface{}) *MockBackend_CreateWorkflowInstance_Call
- func (_e *MockBackend_Expecter) ExtendActivityTask(ctx interface{}, task interface{}) *MockBackend_ExtendActivityTask_Call
- func (_e *MockBackend_Expecter) ExtendWorkflowTask(ctx interface{}, task interface{}) *MockBackend_ExtendWorkflowTask_Call
- func (_e *MockBackend_Expecter) FeatureSupported(feature interface{}) *MockBackend_FeatureSupported_Call
- func (_e *MockBackend_Expecter) GetActivityTask(ctx interface{}, queues interface{}) *MockBackend_GetActivityTask_Call
- func (_e *MockBackend_Expecter) GetStats(ctx interface{}) *MockBackend_GetStats_Call
- func (_e *MockBackend_Expecter) GetWorkflowInstanceHistory(ctx interface{}, instance interface{}, lastSequenceID interface{}) *MockBackend_GetWorkflowInstanceHistory_Call
- func (_e *MockBackend_Expecter) GetWorkflowInstanceState(ctx interface{}, instance interface{}) *MockBackend_GetWorkflowInstanceState_Call
- func (_e *MockBackend_Expecter) GetWorkflowTask(ctx interface{}, queues interface{}) *MockBackend_GetWorkflowTask_Call
- func (_e *MockBackend_Expecter) Metrics() *MockBackend_Metrics_Call
- func (_e *MockBackend_Expecter) Options() *MockBackend_Options_Call
- func (_e *MockBackend_Expecter) PrepareActivityQueues(ctx interface{}, queues interface{}) *MockBackend_PrepareActivityQueues_Call
- func (_e *MockBackend_Expecter) PrepareWorkflowQueues(ctx interface{}, queues interface{}) *MockBackend_PrepareWorkflowQueues_Call
- func (_e *MockBackend_Expecter) RemoveWorkflowInstance(ctx interface{}, instance interface{}) *MockBackend_RemoveWorkflowInstance_Call
- func (_e *MockBackend_Expecter) RemoveWorkflowInstances(ctx interface{}, options ...interface{}) *MockBackend_RemoveWorkflowInstances_Call
- func (_e *MockBackend_Expecter) SignalWorkflow(ctx interface{}, instanceID interface{}, event interface{}) *MockBackend_SignalWorkflow_Call
- func (_e *MockBackend_Expecter) Tracer() *MockBackend_Tracer_Call
- type MockBackend_ExtendActivityTask_Call
- func (_c *MockBackend_ExtendActivityTask_Call) Return(err error) *MockBackend_ExtendActivityTask_Call
- func (_c *MockBackend_ExtendActivityTask_Call) Run(run func(ctx context.Context, task *ActivityTask)) *MockBackend_ExtendActivityTask_Call
- func (_c *MockBackend_ExtendActivityTask_Call) RunAndReturn(run func(ctx context.Context, task *ActivityTask) error) *MockBackend_ExtendActivityTask_Call
- type MockBackend_ExtendWorkflowTask_Call
- func (_c *MockBackend_ExtendWorkflowTask_Call) Return(err error) *MockBackend_ExtendWorkflowTask_Call
- func (_c *MockBackend_ExtendWorkflowTask_Call) Run(run func(ctx context.Context, task *WorkflowTask)) *MockBackend_ExtendWorkflowTask_Call
- func (_c *MockBackend_ExtendWorkflowTask_Call) RunAndReturn(run func(ctx context.Context, task *WorkflowTask) error) *MockBackend_ExtendWorkflowTask_Call
- type MockBackend_FeatureSupported_Call
- func (_c *MockBackend_FeatureSupported_Call) Return(b bool) *MockBackend_FeatureSupported_Call
- func (_c *MockBackend_FeatureSupported_Call) Run(run func(feature Feature)) *MockBackend_FeatureSupported_Call
- func (_c *MockBackend_FeatureSupported_Call) RunAndReturn(run func(feature Feature) bool) *MockBackend_FeatureSupported_Call
- type MockBackend_GetActivityTask_Call
- func (_c *MockBackend_GetActivityTask_Call) Return(activityTask *ActivityTask, err error) *MockBackend_GetActivityTask_Call
- func (_c *MockBackend_GetActivityTask_Call) Run(run func(ctx context.Context, queues []workflow.Queue)) *MockBackend_GetActivityTask_Call
- func (_c *MockBackend_GetActivityTask_Call) RunAndReturn(run func(ctx context.Context, queues []workflow.Queue) (*ActivityTask, error)) *MockBackend_GetActivityTask_Call
- type MockBackend_GetStats_Call
- func (_c *MockBackend_GetStats_Call) Return(stats *Stats, err error) *MockBackend_GetStats_Call
- func (_c *MockBackend_GetStats_Call) Run(run func(ctx context.Context)) *MockBackend_GetStats_Call
- func (_c *MockBackend_GetStats_Call) RunAndReturn(run func(ctx context.Context) (*Stats, error)) *MockBackend_GetStats_Call
- type MockBackend_GetWorkflowInstanceHistory_Call
- func (_c *MockBackend_GetWorkflowInstanceHistory_Call) Return(events []*history.Event, err error) *MockBackend_GetWorkflowInstanceHistory_Call
- func (_c *MockBackend_GetWorkflowInstanceHistory_Call) Run(...) *MockBackend_GetWorkflowInstanceHistory_Call
- func (_c *MockBackend_GetWorkflowInstanceHistory_Call) RunAndReturn(...) *MockBackend_GetWorkflowInstanceHistory_Call
- type MockBackend_GetWorkflowInstanceState_Call
- func (_c *MockBackend_GetWorkflowInstanceState_Call) Return(workflowInstanceState core.WorkflowInstanceState, err error) *MockBackend_GetWorkflowInstanceState_Call
- func (_c *MockBackend_GetWorkflowInstanceState_Call) Run(run func(ctx context.Context, instance *workflow.Instance)) *MockBackend_GetWorkflowInstanceState_Call
- func (_c *MockBackend_GetWorkflowInstanceState_Call) RunAndReturn(...) *MockBackend_GetWorkflowInstanceState_Call
- type MockBackend_GetWorkflowTask_Call
- func (_c *MockBackend_GetWorkflowTask_Call) Return(workflowTask *WorkflowTask, err error) *MockBackend_GetWorkflowTask_Call
- func (_c *MockBackend_GetWorkflowTask_Call) Run(run func(ctx context.Context, queues []workflow.Queue)) *MockBackend_GetWorkflowTask_Call
- func (_c *MockBackend_GetWorkflowTask_Call) RunAndReturn(run func(ctx context.Context, queues []workflow.Queue) (*WorkflowTask, error)) *MockBackend_GetWorkflowTask_Call
- type MockBackend_Metrics_Call
- type MockBackend_Options_Call
- type MockBackend_PrepareActivityQueues_Call
- func (_c *MockBackend_PrepareActivityQueues_Call) Return(err error) *MockBackend_PrepareActivityQueues_Call
- func (_c *MockBackend_PrepareActivityQueues_Call) Run(run func(ctx context.Context, queues []workflow.Queue)) *MockBackend_PrepareActivityQueues_Call
- func (_c *MockBackend_PrepareActivityQueues_Call) RunAndReturn(run func(ctx context.Context, queues []workflow.Queue) error) *MockBackend_PrepareActivityQueues_Call
- type MockBackend_PrepareWorkflowQueues_Call
- func (_c *MockBackend_PrepareWorkflowQueues_Call) Return(err error) *MockBackend_PrepareWorkflowQueues_Call
- func (_c *MockBackend_PrepareWorkflowQueues_Call) Run(run func(ctx context.Context, queues []workflow.Queue)) *MockBackend_PrepareWorkflowQueues_Call
- func (_c *MockBackend_PrepareWorkflowQueues_Call) RunAndReturn(run func(ctx context.Context, queues []workflow.Queue) error) *MockBackend_PrepareWorkflowQueues_Call
- type MockBackend_RemoveWorkflowInstance_Call
- func (_c *MockBackend_RemoveWorkflowInstance_Call) Return(err error) *MockBackend_RemoveWorkflowInstance_Call
- func (_c *MockBackend_RemoveWorkflowInstance_Call) Run(run func(ctx context.Context, instance *workflow.Instance)) *MockBackend_RemoveWorkflowInstance_Call
- func (_c *MockBackend_RemoveWorkflowInstance_Call) RunAndReturn(run func(ctx context.Context, instance *workflow.Instance) error) *MockBackend_RemoveWorkflowInstance_Call
- type MockBackend_RemoveWorkflowInstances_Call
- func (_c *MockBackend_RemoveWorkflowInstances_Call) Return(err error) *MockBackend_RemoveWorkflowInstances_Call
- func (_c *MockBackend_RemoveWorkflowInstances_Call) Run(run func(ctx context.Context, options ...RemovalOption)) *MockBackend_RemoveWorkflowInstances_Call
- func (_c *MockBackend_RemoveWorkflowInstances_Call) RunAndReturn(run func(ctx context.Context, options ...RemovalOption) error) *MockBackend_RemoveWorkflowInstances_Call
- type MockBackend_SignalWorkflow_Call
- func (_c *MockBackend_SignalWorkflow_Call) Return(err error) *MockBackend_SignalWorkflow_Call
- func (_c *MockBackend_SignalWorkflow_Call) Run(run func(ctx context.Context, instanceID string, event *history.Event)) *MockBackend_SignalWorkflow_Call
- func (_c *MockBackend_SignalWorkflow_Call) RunAndReturn(run func(ctx context.Context, instanceID string, event *history.Event) error) *MockBackend_SignalWorkflow_Call
- type MockBackend_Tracer_Call
- type Options
- type RemovalOption
- type RemovalOptions
- type Stats
- type WorkflowTask
Constants ¶
const TracerName = "go-workflow"
Variables ¶
var ( ErrInstanceNotFound = errors.New("workflow instance not found") ErrInstanceAlreadyExists = errors.New("workflow instance already exists") ErrInstanceNotFinished = errors.New("workflow instance is not finished") )
var DefaultRemovalOptions = RemovalOptions{
BatchSize: 100,
}
Functions ¶
This section is empty.
Types ¶
type ActivityTask ¶
type ActivityTask struct {
ID string
// ActivityID is the ID of the activity event
ActivityID string
Queue workflow.Queue
WorkflowInstance *core.WorkflowInstance
Event *history.Event
}
ActivityTask represents one activity execution.
type Backend ¶
type Backend interface {
// CreateWorkflowInstance creates a new workflow instance
CreateWorkflowInstance(ctx context.Context, instance *workflow.Instance, event *history.Event) error
// CancelWorkflowInstance cancels a running workflow instance
CancelWorkflowInstance(ctx context.Context, instance *workflow.Instance, cancelEvent *history.Event) error
// RemoveWorkflowInstance removes a workflow instance
RemoveWorkflowInstance(ctx context.Context, instance *workflow.Instance) error
// RemoveWorkflowInstances removes multiple workflow instances
RemoveWorkflowInstances(ctx context.Context, options ...RemovalOption) error
// GetWorkflowInstanceState returns the state of the given workflow instance
GetWorkflowInstanceState(ctx context.Context, instance *workflow.Instance) (core.WorkflowInstanceState, error)
// GetWorkflowInstanceHistory returns the workflow history for the given instance. When lastSequenceID
// is given, only events after that event are returned. Otherwise the full history is returned.
GetWorkflowInstanceHistory(ctx context.Context, instance *workflow.Instance, lastSequenceID *int64) ([]*history.Event, error)
// SignalWorkflow signals a running workflow instance
//
// If the given instance does not exist, it will return an error
SignalWorkflow(ctx context.Context, instanceID string, event *history.Event) error
// PrepareWorkflowQueues prepares workflow queues for later consumption using this backend instane
PrepareWorkflowQueues(ctx context.Context, queues []workflow.Queue) error
// PrepareActivityQueues prepares activity queues for later consumption using this backend instance
PrepareActivityQueues(ctx context.Context, queues []workflow.Queue) error
// GetWorkflowTask returns a pending workflow task or nil if there are no pending workflow executions
GetWorkflowTask(ctx context.Context, queues []workflow.Queue) (*WorkflowTask, error)
// ExtendWorkflowTask extends the lock of a workflow task
ExtendWorkflowTask(ctx context.Context, task *WorkflowTask) error
// CompleteWorkflowTask checkpoints a workflow task retrieved using GetWorkflowTask
//
// This checkpoints the execution. events are new events from the last workflow execution
// which will be added to the workflow instance history. workflowEvents are new events for the
// completed or other workflow instances.
CompleteWorkflowTask(
ctx context.Context, task *WorkflowTask, state core.WorkflowInstanceState,
executedEvents, activityEvents, timerEvents []*history.Event, workflowEvents []*history.WorkflowEvent) error
// GetActivityTask returns a pending activity task or nil if there are no pending activities
GetActivityTask(ctx context.Context, queues []workflow.Queue) (*ActivityTask, error)
// ExtendActivityTask extends the lock of an activity task
ExtendActivityTask(ctx context.Context, task *ActivityTask) error
// CompleteActivityTask completes an activity task retrieved using GetActivityTask
CompleteActivityTask(ctx context.Context, task *ActivityTask, result *history.Event) error
// GetStats returns stats about the backend
GetStats(ctx context.Context) (*Stats, error)
// Tracer returns the configured trace provider for the backend
Tracer() trace.Tracer
// Metrics returns the configured metrics client for the backend
Metrics() metrics.Client
// Options returns the configured options for the backend
Options() *Options
// Close closes any underlying resources
Close() error
// FeatureSupported returns true if the given feature is supported by the backend
FeatureSupported(feature Feature) bool
}
type BackendOption ¶
type BackendOption func(*Options)
func WithActivityLockTimeout ¶
func WithActivityLockTimeout(timeout time.Duration) BackendOption
WithActivityLockTimeout sets the timeout for activity task locks. If an activity task is not completed within this timeframe, it's considered abandoned and another worker might pick it up.
func WithContextPropagator ¶
func WithContextPropagator(prop workflow.ContextPropagator) BackendOption
WithContextPropagator adds a context propagator for passing context into workflows and activities. Multiple propagators can be added by calling this function multiple times.
func WithConverter ¶
func WithConverter(converter converter.Converter) BackendOption
WithConverter sets a custom converter for serializing and deserializing workflow inputs and results. If not set, converter.DefaultConverter will be used.
func WithLogger ¶
func WithLogger(logger *slog.Logger) BackendOption
WithLogger sets a custom logger for the backend. If not set, slog.Default() will be used.
func WithMaxHistorySize ¶
func WithMaxHistorySize(size int64) BackendOption
WithMaxHistorySize sets the maximum size of a workflow history in bytes. If a workflow exceeds this size, it will be failed to prevent unbounded growth.
func WithMetrics ¶
func WithMetrics(client metrics.Client) BackendOption
WithMetrics sets a custom metrics client for collecting workflow execution metrics. If not set, a no-op metrics client will be used.
func WithRemoveContinuedAsNewInstances ¶
func WithRemoveContinuedAsNewInstances() BackendOption
WithRemoveContinuedAsNewInstances enables immediate removal of workflow instances that completed using ContinueAsNew, including their history. If not set, instances will be removed after the configured retention period or never.
func WithStickyTimeout ¶
func WithStickyTimeout(timeout time.Duration) BackendOption
WithStickyTimeout sets the sticky timeout duration for workflow executions. This determines how long a worker will hold onto a workflow execution context before releasing it back to the task queue.
func WithTracerProvider ¶
func WithTracerProvider(tp trace.TracerProvider) BackendOption
WithTracerProvider sets a custom OpenTelemetry tracer provider for distributed tracing. If not set, a no-op tracer provider will be used.
func WithWorkerName ¶
func WithWorkerName(workerName string) BackendOption
WithWorkerName sets a custom name for this worker instance. If not set, backends will generate a default name based on hostname and process ID.
func WithWorkflowLockTimeout ¶
func WithWorkflowLockTimeout(timeout time.Duration) BackendOption
WithWorkflowLockTimeout sets the timeout for workflow task locks. If a workflow task is not completed within this timeframe, it's considered abandoned and another worker might pick it up.
type ErrNotSupported ¶
type ErrNotSupported struct {
Message string
}
func (ErrNotSupported) Error ¶
func (e ErrNotSupported) Error() string
type MockBackend ¶
MockBackend is an autogenerated mock type for the Backend type
func NewMockBackend ¶
func NewMockBackend(t interface {
mock.TestingT
Cleanup(func())
}) *MockBackend
NewMockBackend creates a new instance of MockBackend. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockBackend) CancelWorkflowInstance ¶
func (_mock *MockBackend) CancelWorkflowInstance(ctx context.Context, instance *workflow.Instance, cancelEvent *history.Event) error
CancelWorkflowInstance provides a mock function for the type MockBackend
func (*MockBackend) Close ¶
func (_mock *MockBackend) Close() error
Close provides a mock function for the type MockBackend
func (*MockBackend) CompleteActivityTask ¶
func (_mock *MockBackend) CompleteActivityTask(ctx context.Context, task *ActivityTask, result *history.Event) error
CompleteActivityTask provides a mock function for the type MockBackend
func (*MockBackend) CompleteWorkflowTask ¶
func (_mock *MockBackend) CompleteWorkflowTask(ctx context.Context, task *WorkflowTask, state core.WorkflowInstanceState, executedEvents []*history.Event, activityEvents []*history.Event, timerEvents []*history.Event, workflowEvents []*history.WorkflowEvent) error
CompleteWorkflowTask provides a mock function for the type MockBackend
func (*MockBackend) CreateWorkflowInstance ¶
func (_mock *MockBackend) CreateWorkflowInstance(ctx context.Context, instance *workflow.Instance, event *history.Event) error
CreateWorkflowInstance provides a mock function for the type MockBackend
func (*MockBackend) EXPECT ¶
func (_m *MockBackend) EXPECT() *MockBackend_Expecter
func (*MockBackend) ExtendActivityTask ¶
func (_mock *MockBackend) ExtendActivityTask(ctx context.Context, task *ActivityTask) error
ExtendActivityTask provides a mock function for the type MockBackend
func (*MockBackend) ExtendWorkflowTask ¶
func (_mock *MockBackend) ExtendWorkflowTask(ctx context.Context, task *WorkflowTask) error
ExtendWorkflowTask provides a mock function for the type MockBackend
func (*MockBackend) FeatureSupported ¶
func (_mock *MockBackend) FeatureSupported(feature Feature) bool
FeatureSupported provides a mock function for the type MockBackend
func (*MockBackend) GetActivityTask ¶
func (_mock *MockBackend) GetActivityTask(ctx context.Context, queues []workflow.Queue) (*ActivityTask, error)
GetActivityTask provides a mock function for the type MockBackend
func (*MockBackend) GetStats ¶
func (_mock *MockBackend) GetStats(ctx context.Context) (*Stats, error)
GetStats provides a mock function for the type MockBackend
func (*MockBackend) GetWorkflowInstanceHistory ¶
func (_mock *MockBackend) GetWorkflowInstanceHistory(ctx context.Context, instance *workflow.Instance, lastSequenceID *int64) ([]*history.Event, error)
GetWorkflowInstanceHistory provides a mock function for the type MockBackend
func (*MockBackend) GetWorkflowInstanceState ¶
func (_mock *MockBackend) GetWorkflowInstanceState(ctx context.Context, instance *workflow.Instance) (core.WorkflowInstanceState, error)
GetWorkflowInstanceState provides a mock function for the type MockBackend
func (*MockBackend) GetWorkflowTask ¶
func (_mock *MockBackend) GetWorkflowTask(ctx context.Context, queues []workflow.Queue) (*WorkflowTask, error)
GetWorkflowTask provides a mock function for the type MockBackend
func (*MockBackend) Metrics ¶
func (_mock *MockBackend) Metrics() metrics.Client
Metrics provides a mock function for the type MockBackend
func (*MockBackend) Options ¶
func (_mock *MockBackend) Options() *Options
Options provides a mock function for the type MockBackend
func (*MockBackend) PrepareActivityQueues ¶
PrepareActivityQueues provides a mock function for the type MockBackend
func (*MockBackend) PrepareWorkflowQueues ¶
PrepareWorkflowQueues provides a mock function for the type MockBackend
func (*MockBackend) RemoveWorkflowInstance ¶
func (_mock *MockBackend) RemoveWorkflowInstance(ctx context.Context, instance *workflow.Instance) error
RemoveWorkflowInstance provides a mock function for the type MockBackend
func (*MockBackend) RemoveWorkflowInstances ¶
func (_mock *MockBackend) RemoveWorkflowInstances(ctx context.Context, options ...RemovalOption) error
RemoveWorkflowInstances provides a mock function for the type MockBackend
func (*MockBackend) SignalWorkflow ¶
func (_mock *MockBackend) SignalWorkflow(ctx context.Context, instanceID string, event *history.Event) error
SignalWorkflow provides a mock function for the type MockBackend
func (*MockBackend) Tracer ¶
func (_mock *MockBackend) Tracer() trace.Tracer
Tracer provides a mock function for the type MockBackend
type MockBackend_CancelWorkflowInstance_Call ¶
MockBackend_CancelWorkflowInstance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CancelWorkflowInstance'
func (*MockBackend_CancelWorkflowInstance_Call) Return ¶
func (_c *MockBackend_CancelWorkflowInstance_Call) Return(err error) *MockBackend_CancelWorkflowInstance_Call
func (*MockBackend_CancelWorkflowInstance_Call) Run ¶
func (_c *MockBackend_CancelWorkflowInstance_Call) Run(run func(ctx context.Context, instance *workflow.Instance, cancelEvent *history.Event)) *MockBackend_CancelWorkflowInstance_Call
func (*MockBackend_CancelWorkflowInstance_Call) RunAndReturn ¶
func (_c *MockBackend_CancelWorkflowInstance_Call) RunAndReturn(run func(ctx context.Context, instance *workflow.Instance, cancelEvent *history.Event) error) *MockBackend_CancelWorkflowInstance_Call
type MockBackend_Close_Call ¶
MockBackend_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
func (*MockBackend_Close_Call) Return ¶
func (_c *MockBackend_Close_Call) Return(err error) *MockBackend_Close_Call
func (*MockBackend_Close_Call) Run ¶
func (_c *MockBackend_Close_Call) Run(run func()) *MockBackend_Close_Call
func (*MockBackend_Close_Call) RunAndReturn ¶
func (_c *MockBackend_Close_Call) RunAndReturn(run func() error) *MockBackend_Close_Call
type MockBackend_CompleteActivityTask_Call ¶
MockBackend_CompleteActivityTask_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompleteActivityTask'
func (*MockBackend_CompleteActivityTask_Call) Return ¶
func (_c *MockBackend_CompleteActivityTask_Call) Return(err error) *MockBackend_CompleteActivityTask_Call
func (*MockBackend_CompleteActivityTask_Call) Run ¶
func (_c *MockBackend_CompleteActivityTask_Call) Run(run func(ctx context.Context, task *ActivityTask, result *history.Event)) *MockBackend_CompleteActivityTask_Call
func (*MockBackend_CompleteActivityTask_Call) RunAndReturn ¶
func (_c *MockBackend_CompleteActivityTask_Call) RunAndReturn(run func(ctx context.Context, task *ActivityTask, result *history.Event) error) *MockBackend_CompleteActivityTask_Call
type MockBackend_CompleteWorkflowTask_Call ¶
MockBackend_CompleteWorkflowTask_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompleteWorkflowTask'
func (*MockBackend_CompleteWorkflowTask_Call) Return ¶
func (_c *MockBackend_CompleteWorkflowTask_Call) Return(err error) *MockBackend_CompleteWorkflowTask_Call
func (*MockBackend_CompleteWorkflowTask_Call) Run ¶
func (_c *MockBackend_CompleteWorkflowTask_Call) Run(run func(ctx context.Context, task *WorkflowTask, state core.WorkflowInstanceState, executedEvents []*history.Event, activityEvents []*history.Event, timerEvents []*history.Event, workflowEvents []*history.WorkflowEvent)) *MockBackend_CompleteWorkflowTask_Call
func (*MockBackend_CompleteWorkflowTask_Call) RunAndReturn ¶
func (_c *MockBackend_CompleteWorkflowTask_Call) RunAndReturn(run func(ctx context.Context, task *WorkflowTask, state core.WorkflowInstanceState, executedEvents []*history.Event, activityEvents []*history.Event, timerEvents []*history.Event, workflowEvents []*history.WorkflowEvent) error) *MockBackend_CompleteWorkflowTask_Call
type MockBackend_CreateWorkflowInstance_Call ¶
MockBackend_CreateWorkflowInstance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateWorkflowInstance'
func (*MockBackend_CreateWorkflowInstance_Call) Return ¶
func (_c *MockBackend_CreateWorkflowInstance_Call) Return(err error) *MockBackend_CreateWorkflowInstance_Call
func (*MockBackend_CreateWorkflowInstance_Call) Run ¶
func (_c *MockBackend_CreateWorkflowInstance_Call) Run(run func(ctx context.Context, instance *workflow.Instance, event *history.Event)) *MockBackend_CreateWorkflowInstance_Call
func (*MockBackend_CreateWorkflowInstance_Call) RunAndReturn ¶
func (_c *MockBackend_CreateWorkflowInstance_Call) RunAndReturn(run func(ctx context.Context, instance *workflow.Instance, event *history.Event) error) *MockBackend_CreateWorkflowInstance_Call
type MockBackend_Expecter ¶
type MockBackend_Expecter struct {
// contains filtered or unexported fields
}
func (*MockBackend_Expecter) CancelWorkflowInstance ¶
func (_e *MockBackend_Expecter) CancelWorkflowInstance(ctx interface{}, instance interface{}, cancelEvent interface{}) *MockBackend_CancelWorkflowInstance_Call
CancelWorkflowInstance is a helper method to define mock.On call
- ctx context.Context
- instance *workflow.Instance
- cancelEvent *history.Event
func (*MockBackend_Expecter) Close ¶
func (_e *MockBackend_Expecter) Close() *MockBackend_Close_Call
Close is a helper method to define mock.On call
func (*MockBackend_Expecter) CompleteActivityTask ¶
func (_e *MockBackend_Expecter) CompleteActivityTask(ctx interface{}, task interface{}, result interface{}) *MockBackend_CompleteActivityTask_Call
CompleteActivityTask is a helper method to define mock.On call
- ctx context.Context
- task *ActivityTask
- result *history.Event
func (*MockBackend_Expecter) CompleteWorkflowTask ¶
func (_e *MockBackend_Expecter) CompleteWorkflowTask(ctx interface{}, task interface{}, state interface{}, executedEvents interface{}, activityEvents interface{}, timerEvents interface{}, workflowEvents interface{}) *MockBackend_CompleteWorkflowTask_Call
CompleteWorkflowTask is a helper method to define mock.On call
- ctx context.Context
- task *WorkflowTask
- state core.WorkflowInstanceState
- executedEvents []*history.Event
- activityEvents []*history.Event
- timerEvents []*history.Event
- workflowEvents []*history.WorkflowEvent
func (*MockBackend_Expecter) CreateWorkflowInstance ¶
func (_e *MockBackend_Expecter) CreateWorkflowInstance(ctx interface{}, instance interface{}, event interface{}) *MockBackend_CreateWorkflowInstance_Call
CreateWorkflowInstance is a helper method to define mock.On call
- ctx context.Context
- instance *workflow.Instance
- event *history.Event
func (*MockBackend_Expecter) ExtendActivityTask ¶
func (_e *MockBackend_Expecter) ExtendActivityTask(ctx interface{}, task interface{}) *MockBackend_ExtendActivityTask_Call
ExtendActivityTask is a helper method to define mock.On call
- ctx context.Context
- task *ActivityTask
func (*MockBackend_Expecter) ExtendWorkflowTask ¶
func (_e *MockBackend_Expecter) ExtendWorkflowTask(ctx interface{}, task interface{}) *MockBackend_ExtendWorkflowTask_Call
ExtendWorkflowTask is a helper method to define mock.On call
- ctx context.Context
- task *WorkflowTask
func (*MockBackend_Expecter) FeatureSupported ¶
func (_e *MockBackend_Expecter) FeatureSupported(feature interface{}) *MockBackend_FeatureSupported_Call
FeatureSupported is a helper method to define mock.On call
- feature Feature
func (*MockBackend_Expecter) GetActivityTask ¶
func (_e *MockBackend_Expecter) GetActivityTask(ctx interface{}, queues interface{}) *MockBackend_GetActivityTask_Call
GetActivityTask is a helper method to define mock.On call
- ctx context.Context
- queues []workflow.Queue
func (*MockBackend_Expecter) GetStats ¶
func (_e *MockBackend_Expecter) GetStats(ctx interface{}) *MockBackend_GetStats_Call
GetStats is a helper method to define mock.On call
- ctx context.Context
func (*MockBackend_Expecter) GetWorkflowInstanceHistory ¶
func (_e *MockBackend_Expecter) GetWorkflowInstanceHistory(ctx interface{}, instance interface{}, lastSequenceID interface{}) *MockBackend_GetWorkflowInstanceHistory_Call
GetWorkflowInstanceHistory is a helper method to define mock.On call
- ctx context.Context
- instance *workflow.Instance
- lastSequenceID *int64
func (*MockBackend_Expecter) GetWorkflowInstanceState ¶
func (_e *MockBackend_Expecter) GetWorkflowInstanceState(ctx interface{}, instance interface{}) *MockBackend_GetWorkflowInstanceState_Call
GetWorkflowInstanceState is a helper method to define mock.On call
- ctx context.Context
- instance *workflow.Instance
func (*MockBackend_Expecter) GetWorkflowTask ¶
func (_e *MockBackend_Expecter) GetWorkflowTask(ctx interface{}, queues interface{}) *MockBackend_GetWorkflowTask_Call
GetWorkflowTask is a helper method to define mock.On call
- ctx context.Context
- queues []workflow.Queue
func (*MockBackend_Expecter) Metrics ¶
func (_e *MockBackend_Expecter) Metrics() *MockBackend_Metrics_Call
Metrics is a helper method to define mock.On call
func (*MockBackend_Expecter) Options ¶
func (_e *MockBackend_Expecter) Options() *MockBackend_Options_Call
Options is a helper method to define mock.On call
func (*MockBackend_Expecter) PrepareActivityQueues ¶
func (_e *MockBackend_Expecter) PrepareActivityQueues(ctx interface{}, queues interface{}) *MockBackend_PrepareActivityQueues_Call
PrepareActivityQueues is a helper method to define mock.On call
- ctx context.Context
- queues []workflow.Queue
func (*MockBackend_Expecter) PrepareWorkflowQueues ¶
func (_e *MockBackend_Expecter) PrepareWorkflowQueues(ctx interface{}, queues interface{}) *MockBackend_PrepareWorkflowQueues_Call
PrepareWorkflowQueues is a helper method to define mock.On call
- ctx context.Context
- queues []workflow.Queue
func (*MockBackend_Expecter) RemoveWorkflowInstance ¶
func (_e *MockBackend_Expecter) RemoveWorkflowInstance(ctx interface{}, instance interface{}) *MockBackend_RemoveWorkflowInstance_Call
RemoveWorkflowInstance is a helper method to define mock.On call
- ctx context.Context
- instance *workflow.Instance
func (*MockBackend_Expecter) RemoveWorkflowInstances ¶
func (_e *MockBackend_Expecter) RemoveWorkflowInstances(ctx interface{}, options ...interface{}) *MockBackend_RemoveWorkflowInstances_Call
RemoveWorkflowInstances is a helper method to define mock.On call
- ctx context.Context
- options ...RemovalOption
func (*MockBackend_Expecter) SignalWorkflow ¶
func (_e *MockBackend_Expecter) SignalWorkflow(ctx interface{}, instanceID interface{}, event interface{}) *MockBackend_SignalWorkflow_Call
SignalWorkflow is a helper method to define mock.On call
- ctx context.Context
- instanceID string
- event *history.Event
func (*MockBackend_Expecter) Tracer ¶
func (_e *MockBackend_Expecter) Tracer() *MockBackend_Tracer_Call
Tracer is a helper method to define mock.On call
type MockBackend_ExtendActivityTask_Call ¶
MockBackend_ExtendActivityTask_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExtendActivityTask'
func (*MockBackend_ExtendActivityTask_Call) Return ¶
func (_c *MockBackend_ExtendActivityTask_Call) Return(err error) *MockBackend_ExtendActivityTask_Call
func (*MockBackend_ExtendActivityTask_Call) Run ¶
func (_c *MockBackend_ExtendActivityTask_Call) Run(run func(ctx context.Context, task *ActivityTask)) *MockBackend_ExtendActivityTask_Call
func (*MockBackend_ExtendActivityTask_Call) RunAndReturn ¶
func (_c *MockBackend_ExtendActivityTask_Call) RunAndReturn(run func(ctx context.Context, task *ActivityTask) error) *MockBackend_ExtendActivityTask_Call
type MockBackend_ExtendWorkflowTask_Call ¶
MockBackend_ExtendWorkflowTask_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExtendWorkflowTask'
func (*MockBackend_ExtendWorkflowTask_Call) Return ¶
func (_c *MockBackend_ExtendWorkflowTask_Call) Return(err error) *MockBackend_ExtendWorkflowTask_Call
func (*MockBackend_ExtendWorkflowTask_Call) Run ¶
func (_c *MockBackend_ExtendWorkflowTask_Call) Run(run func(ctx context.Context, task *WorkflowTask)) *MockBackend_ExtendWorkflowTask_Call
func (*MockBackend_ExtendWorkflowTask_Call) RunAndReturn ¶
func (_c *MockBackend_ExtendWorkflowTask_Call) RunAndReturn(run func(ctx context.Context, task *WorkflowTask) error) *MockBackend_ExtendWorkflowTask_Call
type MockBackend_FeatureSupported_Call ¶
MockBackend_FeatureSupported_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FeatureSupported'
func (*MockBackend_FeatureSupported_Call) Return ¶
func (_c *MockBackend_FeatureSupported_Call) Return(b bool) *MockBackend_FeatureSupported_Call
func (*MockBackend_FeatureSupported_Call) Run ¶
func (_c *MockBackend_FeatureSupported_Call) Run(run func(feature Feature)) *MockBackend_FeatureSupported_Call
func (*MockBackend_FeatureSupported_Call) RunAndReturn ¶
func (_c *MockBackend_FeatureSupported_Call) RunAndReturn(run func(feature Feature) bool) *MockBackend_FeatureSupported_Call
type MockBackend_GetActivityTask_Call ¶
MockBackend_GetActivityTask_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetActivityTask'
func (*MockBackend_GetActivityTask_Call) Return ¶
func (_c *MockBackend_GetActivityTask_Call) Return(activityTask *ActivityTask, err error) *MockBackend_GetActivityTask_Call
func (*MockBackend_GetActivityTask_Call) Run ¶
func (_c *MockBackend_GetActivityTask_Call) Run(run func(ctx context.Context, queues []workflow.Queue)) *MockBackend_GetActivityTask_Call
func (*MockBackend_GetActivityTask_Call) RunAndReturn ¶
func (_c *MockBackend_GetActivityTask_Call) RunAndReturn(run func(ctx context.Context, queues []workflow.Queue) (*ActivityTask, error)) *MockBackend_GetActivityTask_Call
type MockBackend_GetStats_Call ¶
MockBackend_GetStats_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStats'
func (*MockBackend_GetStats_Call) Return ¶
func (_c *MockBackend_GetStats_Call) Return(stats *Stats, err error) *MockBackend_GetStats_Call
func (*MockBackend_GetStats_Call) Run ¶
func (_c *MockBackend_GetStats_Call) Run(run func(ctx context.Context)) *MockBackend_GetStats_Call
func (*MockBackend_GetStats_Call) RunAndReturn ¶
func (_c *MockBackend_GetStats_Call) RunAndReturn(run func(ctx context.Context) (*Stats, error)) *MockBackend_GetStats_Call
type MockBackend_GetWorkflowInstanceHistory_Call ¶
MockBackend_GetWorkflowInstanceHistory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetWorkflowInstanceHistory'
func (*MockBackend_GetWorkflowInstanceHistory_Call) Return ¶
func (_c *MockBackend_GetWorkflowInstanceHistory_Call) Return(events []*history.Event, err error) *MockBackend_GetWorkflowInstanceHistory_Call
func (*MockBackend_GetWorkflowInstanceHistory_Call) Run ¶
func (_c *MockBackend_GetWorkflowInstanceHistory_Call) Run(run func(ctx context.Context, instance *workflow.Instance, lastSequenceID *int64)) *MockBackend_GetWorkflowInstanceHistory_Call
func (*MockBackend_GetWorkflowInstanceHistory_Call) RunAndReturn ¶
func (_c *MockBackend_GetWorkflowInstanceHistory_Call) RunAndReturn(run func(ctx context.Context, instance *workflow.Instance, lastSequenceID *int64) ([]*history.Event, error)) *MockBackend_GetWorkflowInstanceHistory_Call
type MockBackend_GetWorkflowInstanceState_Call ¶
MockBackend_GetWorkflowInstanceState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetWorkflowInstanceState'
func (*MockBackend_GetWorkflowInstanceState_Call) Return ¶
func (_c *MockBackend_GetWorkflowInstanceState_Call) Return(workflowInstanceState core.WorkflowInstanceState, err error) *MockBackend_GetWorkflowInstanceState_Call
func (*MockBackend_GetWorkflowInstanceState_Call) Run ¶
func (_c *MockBackend_GetWorkflowInstanceState_Call) Run(run func(ctx context.Context, instance *workflow.Instance)) *MockBackend_GetWorkflowInstanceState_Call
func (*MockBackend_GetWorkflowInstanceState_Call) RunAndReturn ¶
func (_c *MockBackend_GetWorkflowInstanceState_Call) RunAndReturn(run func(ctx context.Context, instance *workflow.Instance) (core.WorkflowInstanceState, error)) *MockBackend_GetWorkflowInstanceState_Call
type MockBackend_GetWorkflowTask_Call ¶
MockBackend_GetWorkflowTask_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetWorkflowTask'
func (*MockBackend_GetWorkflowTask_Call) Return ¶
func (_c *MockBackend_GetWorkflowTask_Call) Return(workflowTask *WorkflowTask, err error) *MockBackend_GetWorkflowTask_Call
func (*MockBackend_GetWorkflowTask_Call) Run ¶
func (_c *MockBackend_GetWorkflowTask_Call) Run(run func(ctx context.Context, queues []workflow.Queue)) *MockBackend_GetWorkflowTask_Call
func (*MockBackend_GetWorkflowTask_Call) RunAndReturn ¶
func (_c *MockBackend_GetWorkflowTask_Call) RunAndReturn(run func(ctx context.Context, queues []workflow.Queue) (*WorkflowTask, error)) *MockBackend_GetWorkflowTask_Call
type MockBackend_Metrics_Call ¶
MockBackend_Metrics_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Metrics'
func (*MockBackend_Metrics_Call) Return ¶
func (_c *MockBackend_Metrics_Call) Return(client metrics.Client) *MockBackend_Metrics_Call
func (*MockBackend_Metrics_Call) Run ¶
func (_c *MockBackend_Metrics_Call) Run(run func()) *MockBackend_Metrics_Call
func (*MockBackend_Metrics_Call) RunAndReturn ¶
func (_c *MockBackend_Metrics_Call) RunAndReturn(run func() metrics.Client) *MockBackend_Metrics_Call
type MockBackend_Options_Call ¶
MockBackend_Options_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Options'
func (*MockBackend_Options_Call) Return ¶
func (_c *MockBackend_Options_Call) Return(options *Options) *MockBackend_Options_Call
func (*MockBackend_Options_Call) Run ¶
func (_c *MockBackend_Options_Call) Run(run func()) *MockBackend_Options_Call
func (*MockBackend_Options_Call) RunAndReturn ¶
func (_c *MockBackend_Options_Call) RunAndReturn(run func() *Options) *MockBackend_Options_Call
type MockBackend_PrepareActivityQueues_Call ¶
MockBackend_PrepareActivityQueues_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PrepareActivityQueues'
func (*MockBackend_PrepareActivityQueues_Call) Return ¶
func (_c *MockBackend_PrepareActivityQueues_Call) Return(err error) *MockBackend_PrepareActivityQueues_Call
func (*MockBackend_PrepareActivityQueues_Call) Run ¶
func (_c *MockBackend_PrepareActivityQueues_Call) Run(run func(ctx context.Context, queues []workflow.Queue)) *MockBackend_PrepareActivityQueues_Call
func (*MockBackend_PrepareActivityQueues_Call) RunAndReturn ¶
func (_c *MockBackend_PrepareActivityQueues_Call) RunAndReturn(run func(ctx context.Context, queues []workflow.Queue) error) *MockBackend_PrepareActivityQueues_Call
type MockBackend_PrepareWorkflowQueues_Call ¶
MockBackend_PrepareWorkflowQueues_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PrepareWorkflowQueues'
func (*MockBackend_PrepareWorkflowQueues_Call) Return ¶
func (_c *MockBackend_PrepareWorkflowQueues_Call) Return(err error) *MockBackend_PrepareWorkflowQueues_Call
func (*MockBackend_PrepareWorkflowQueues_Call) Run ¶
func (_c *MockBackend_PrepareWorkflowQueues_Call) Run(run func(ctx context.Context, queues []workflow.Queue)) *MockBackend_PrepareWorkflowQueues_Call
func (*MockBackend_PrepareWorkflowQueues_Call) RunAndReturn ¶
func (_c *MockBackend_PrepareWorkflowQueues_Call) RunAndReturn(run func(ctx context.Context, queues []workflow.Queue) error) *MockBackend_PrepareWorkflowQueues_Call
type MockBackend_RemoveWorkflowInstance_Call ¶
MockBackend_RemoveWorkflowInstance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveWorkflowInstance'
func (*MockBackend_RemoveWorkflowInstance_Call) Return ¶
func (_c *MockBackend_RemoveWorkflowInstance_Call) Return(err error) *MockBackend_RemoveWorkflowInstance_Call
func (*MockBackend_RemoveWorkflowInstance_Call) Run ¶
func (_c *MockBackend_RemoveWorkflowInstance_Call) Run(run func(ctx context.Context, instance *workflow.Instance)) *MockBackend_RemoveWorkflowInstance_Call
func (*MockBackend_RemoveWorkflowInstance_Call) RunAndReturn ¶
func (_c *MockBackend_RemoveWorkflowInstance_Call) RunAndReturn(run func(ctx context.Context, instance *workflow.Instance) error) *MockBackend_RemoveWorkflowInstance_Call
type MockBackend_RemoveWorkflowInstances_Call ¶
MockBackend_RemoveWorkflowInstances_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveWorkflowInstances'
func (*MockBackend_RemoveWorkflowInstances_Call) Return ¶
func (_c *MockBackend_RemoveWorkflowInstances_Call) Return(err error) *MockBackend_RemoveWorkflowInstances_Call
func (*MockBackend_RemoveWorkflowInstances_Call) Run ¶
func (_c *MockBackend_RemoveWorkflowInstances_Call) Run(run func(ctx context.Context, options ...RemovalOption)) *MockBackend_RemoveWorkflowInstances_Call
func (*MockBackend_RemoveWorkflowInstances_Call) RunAndReturn ¶
func (_c *MockBackend_RemoveWorkflowInstances_Call) RunAndReturn(run func(ctx context.Context, options ...RemovalOption) error) *MockBackend_RemoveWorkflowInstances_Call
type MockBackend_SignalWorkflow_Call ¶
MockBackend_SignalWorkflow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SignalWorkflow'
func (*MockBackend_SignalWorkflow_Call) Return ¶
func (_c *MockBackend_SignalWorkflow_Call) Return(err error) *MockBackend_SignalWorkflow_Call
func (*MockBackend_SignalWorkflow_Call) Run ¶
func (_c *MockBackend_SignalWorkflow_Call) Run(run func(ctx context.Context, instanceID string, event *history.Event)) *MockBackend_SignalWorkflow_Call
func (*MockBackend_SignalWorkflow_Call) RunAndReturn ¶
func (_c *MockBackend_SignalWorkflow_Call) RunAndReturn(run func(ctx context.Context, instanceID string, event *history.Event) error) *MockBackend_SignalWorkflow_Call
type MockBackend_Tracer_Call ¶
MockBackend_Tracer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Tracer'
func (*MockBackend_Tracer_Call) Return ¶
func (_c *MockBackend_Tracer_Call) Return(tracer trace.Tracer) *MockBackend_Tracer_Call
func (*MockBackend_Tracer_Call) Run ¶
func (_c *MockBackend_Tracer_Call) Run(run func()) *MockBackend_Tracer_Call
func (*MockBackend_Tracer_Call) RunAndReturn ¶
func (_c *MockBackend_Tracer_Call) RunAndReturn(run func() trace.Tracer) *MockBackend_Tracer_Call
type Options ¶
type Options struct {
Logger *slog.Logger
Metrics metrics.Client
TracerProvider trace.TracerProvider
// Converter is the converter to use for serializing and deserializing inputs and results. If not explicitly set
// converter.DefaultConverter is used.
Converter converter.Converter
// ContextPropagators is a list of context propagators to use for passing context into workflows and activities.
ContextPropagators []workflow.ContextPropagator
StickyTimeout time.Duration
// WorkflowLockTimeout determines how long a workflow task can be locked for. If the workflow task is not completed
// by that timeframe, it's considered abandoned and another worker might pick it up.
//
// For long running workflow tasks, combine this with heartbearts.
WorkflowLockTimeout time.Duration
// ActivityLockTimeout determines how long an activity task can be locked for. If the activity task is not completed
// by that timeframe, it's considered abandoned and another worker might pick it up
ActivityLockTimeout time.Duration
// RemoveContinuedAsNewInstances determines whether instances that were completed using ContinueAsNew should be
// removed immediately, including their history. If set to false, the instance will be removed after the configured
// retention period or never.
RemoveContinuedAsNewInstances bool
// MaxHistorySize is the maximum size of a workflow history. If a workflow exceeds this size, it will be failed.
MaxHistorySize int64
// WorkerName allows setting a custom worker name. If not set, backends will generate a default name.
WorkerName string
}
var DefaultOptions Options = Options{ StickyTimeout: 30 * time.Second, WorkflowLockTimeout: time.Minute, ActivityLockTimeout: time.Minute * 2, Metrics: mi.NewNoopMetricsClient(), TracerProvider: noop.NewTracerProvider(), Converter: converter.DefaultConverter, ContextPropagators: []workflow.ContextPropagator{&propagators.TracingContextPropagator{}, &propagators.ScopeContextPropagator{}}, RemoveContinuedAsNewInstances: false, MaxHistorySize: 10_000, }
func ApplyOptions ¶
func ApplyOptions(opts ...BackendOption) *Options
type RemovalOption ¶
type RemovalOption func(o *RemovalOptions)
func RemoveFinishedBatchSize ¶
func RemoveFinishedBatchSize(size int) RemovalOption
func RemoveFinishedBefore ¶
func RemoveFinishedBefore(t time.Time) RemovalOption
type RemovalOptions ¶
type Stats ¶
type Stats struct {
ActiveWorkflowInstances int64
// PendingActivities are the number of activities that are currently in the queue,
// waiting to be processed by a worker
PendingActivityTasks map[workflow.Queue]int64
// PendingWorkflowTasks are the number of workflow tasks that are currently in the queue,
// waiting to be processed by a worker
PendingWorkflowTasks map[workflow.Queue]int64
}
type WorkflowTask ¶
type WorkflowTask struct {
// ID is an identifier for this task. It's set by the backend
ID string
// Queue is the queue of the workflow instance
Queue workflow.Queue
// WorkflowInstance is the workflow instance that this task is for
WorkflowInstance *core.WorkflowInstance
// WorkflowInstanceState is the state of the workflow instance when the task was dequeued
WorkflowInstanceState core.WorkflowInstanceState
// Metadata is the metadata of the workflow instance
Metadata *metadata.WorkflowMetadata
// LastSequenceID is the sequence ID of the newest event in the workflow instances's history
LastSequenceID int64
// NewEvents are new events since the last task execution
NewEvents []*history.Event
// Backend specific data, only the producer of the task should rely on this.
CustomData any
}
WorkflowTask represents work for one workflow execution slice.