actors

package
v1.17.2 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Overview

Copyright 2025 The Dapr Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	WorkflowNameLabelKey    = "workflow"
	ActivityNameLabelKey    = "activity"
	ExecutorNameLabelKey    = "executor"
	RetentionerNameLabelKey = "retentioner"
	ActorTypePrefix         = "dapr.internal."
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Actors added in v1.15.0

type Actors struct {
	// contains filtered or unexported fields
}

func New added in v1.15.0

func New(opts Options) *Actors

func (*Actors) AbandonActivityWorkItem added in v1.15.0

func (*Actors) AbandonActivityWorkItem(ctx context.Context, wi *backend.ActivityWorkItem) error

AbandonActivityWorkItem implements backend.Backend. It gets called by durabletask-go when there is an unexpected failure in the workflow activity execution pipeline.

func (*Actors) AbandonOrchestrationWorkItem added in v1.15.0

func (*Actors) AbandonOrchestrationWorkItem(ctx context.Context, wi *backend.OrchestrationWorkItem) error

AbandonOrchestrationWorkItem implements backend.Backend. It gets called by durabletask-go when there is an unexpected failure in the workflow orchestration execution pipeline.

func (*Actors) ActivityActorType added in v1.15.0

func (abe *Actors) ActivityActorType() string

func (*Actors) AddNewOrchestrationEvent added in v1.15.0

func (abe *Actors) AddNewOrchestrationEvent(ctx context.Context, id api.InstanceID, e *backend.HistoryEvent) error

AddNewOrchestrationEvent implements backend.Backend and sends the event e to the workflow actor identified by id.

func (*Actors) CancelActivityTask added in v1.16.0

func (abe *Actors) CancelActivityTask(ctx context.Context, instanceID api.InstanceID, taskID int32) error

CancelActivityTask implements backend.Backend.

func (*Actors) CancelOrchestratorTask added in v1.16.0

func (abe *Actors) CancelOrchestratorTask(ctx context.Context, instanceID api.InstanceID) error

CancelOrchestratorTask implements backend.Backend.

func (*Actors) CompleteActivityTask added in v1.16.0

func (abe *Actors) CompleteActivityTask(ctx context.Context, response *protos.ActivityResponse) error

CompleteActivityTask implements backend.Backend.

func (*Actors) CompleteActivityWorkItem added in v1.15.0

func (*Actors) CompleteActivityWorkItem(ctx context.Context, wi *backend.ActivityWorkItem) error

CompleteActivityWorkItem implements backend.Backend

func (*Actors) CompleteOrchestrationWorkItem added in v1.15.0

func (*Actors) CompleteOrchestrationWorkItem(ctx context.Context, wi *backend.OrchestrationWorkItem) error

CompleteOrchestrationWorkItem implements backend.Backend

func (*Actors) CompleteOrchestratorTask added in v1.16.0

func (abe *Actors) CompleteOrchestratorTask(ctx context.Context, response *protos.OrchestratorResponse) error

CompleteOrchestratorTask implements backend.Backend.

func (*Actors) CreateOrchestrationInstance added in v1.15.0

func (abe *Actors) CreateOrchestrationInstance(ctx context.Context, e *backend.HistoryEvent, opts ...backend.OrchestrationIdReusePolicyOptions) error

CreateOrchestrationInstance implements backend.Backend and creates a new workflow instance.

Internally, creating a workflow instance also creates a new actor with the same ID. The create request is saved into the actor's "inbox" and then executed via a reminder thread. If the app is scaled out across multiple replicas, the actor might get assigned to a replicas other than this one.

func (*Actors) CreateTaskHub added in v1.15.0

func (*Actors) CreateTaskHub(context.Context) error

CreateTaskHub implements backend.Backend

func (*Actors) DeleteTaskHub added in v1.15.0

func (*Actors) DeleteTaskHub(context.Context) error

DeleteTaskHub implements backend.Backend

func (*Actors) GetInstanceHistory added in v1.17.0

func (*Actors) GetOrchestrationMetadata added in v1.15.0

func (abe *Actors) GetOrchestrationMetadata(ctx context.Context, id api.InstanceID) (*backend.OrchestrationMetadata, error)

GetOrchestrationMetadata implements backend.Backend

func (*Actors) GetOrchestrationRuntimeState added in v1.15.0

func (abe *Actors) GetOrchestrationRuntimeState(ctx context.Context, owi *backend.OrchestrationWorkItem) (*backend.OrchestrationRuntimeState, error)

GetOrchestrationRuntimeState implements backend.Backend

func (*Actors) ListInstanceIDs added in v1.17.0

func (*Actors) NextActivityWorkItem added in v1.15.0

func (abe *Actors) NextActivityWorkItem(ctx context.Context) (*backend.ActivityWorkItem, error)

NextActivityWorkItem implements backend.Backend

func (*Actors) NextOrchestrationWorkItem added in v1.15.0

func (abe *Actors) NextOrchestrationWorkItem(ctx context.Context) (*backend.OrchestrationWorkItem, error)

NextOrchestrationWorkItem implements backend.Backend

func (*Actors) PurgeOrchestrationState added in v1.15.0

func (abe *Actors) PurgeOrchestrationState(ctx context.Context, id api.InstanceID, force bool) error

PurgeOrchestrationState deletes all saved state for the specific orchestration instance.

func (*Actors) RegisterActors added in v1.15.0

func (abe *Actors) RegisterActors(ctx context.Context) error

func (*Actors) RerunWorkflowFromEvent added in v1.16.0

func (abe *Actors) RerunWorkflowFromEvent(ctx context.Context, req *backend.RerunWorkflowFromEventRequest) (api.InstanceID, error)

RerunWorkflowFromEvent implements backend.Backend and reruns a workflow from a specific event ID.

func (*Actors) Start added in v1.15.0

func (abe *Actors) Start(ctx context.Context) error

Start implements backend.Backend

func (*Actors) Stop added in v1.15.0

func (abe *Actors) Stop(context.Context) error

Stop implements backend.Backend

func (*Actors) String added in v1.15.0

func (abe *Actors) String() string

String displays the type information

func (*Actors) UnRegisterActors added in v1.15.0

func (abe *Actors) UnRegisterActors(ctx context.Context) error

func (*Actors) WaitForActivityCompletion added in v1.16.0

func (abe *Actors) WaitForActivityCompletion(request *protos.ActivityRequest) func(context.Context) (*protos.ActivityResponse, error)

WaitForActivityCompletion implements backend.Backend.

func (*Actors) WaitForOrchestratorCompletion added in v1.16.0

func (abe *Actors) WaitForOrchestratorCompletion(request *protos.OrchestratorRequest) func(context.Context) (*protos.OrchestratorResponse, error)

WaitForOrchestratorCompletion implements backend.Backend.

func (*Actors) WatchOrchestrationRuntimeStatus added in v1.15.0

func (abe *Actors) WatchOrchestrationRuntimeStatus(ctx context.Context, id api.InstanceID, condition func(*backend.OrchestrationMetadata) bool) error

type ClusterTasksBackend added in v1.16.0

type ClusterTasksBackend struct {
	// contains filtered or unexported fields
}

func NewClusterTasksBackend added in v1.16.0

func NewClusterTasksBackend(opts ClusterTasksBackendOptions) *ClusterTasksBackend

func (*ClusterTasksBackend) CancelActivityTask added in v1.16.0

func (be *ClusterTasksBackend) CancelActivityTask(ctx context.Context, id api.InstanceID, taskID int32) error

func (*ClusterTasksBackend) CancelOrchestratorTask added in v1.16.0

func (be *ClusterTasksBackend) CancelOrchestratorTask(ctx context.Context, id api.InstanceID) error

func (*ClusterTasksBackend) CompleteActivityTask added in v1.16.0

func (be *ClusterTasksBackend) CompleteActivityTask(ctx context.Context, resp *protos.ActivityResponse) error

func (*ClusterTasksBackend) CompleteOrchestratorTask added in v1.16.0

func (be *ClusterTasksBackend) CompleteOrchestratorTask(ctx context.Context, resp *protos.OrchestratorResponse) error

func (*ClusterTasksBackend) WaitForActivityCompletion added in v1.16.0

func (be *ClusterTasksBackend) WaitForActivityCompletion(req *protos.ActivityRequest) func(context.Context) (*protos.ActivityResponse, error)

func (*ClusterTasksBackend) WaitForOrchestratorCompletion added in v1.16.0

func (be *ClusterTasksBackend) WaitForOrchestratorCompletion(req *protos.OrchestratorRequest) func(context.Context) (*protos.OrchestratorResponse, error)

type ClusterTasksBackendOptions added in v1.16.0

type ClusterTasksBackendOptions struct {
	Actors            actors.Interface
	ExecutorActorType string
}

type Options added in v1.15.0

type Options struct {
	AppID          string
	Namespace      string
	Actors         actors.Interface
	Resiliency     resiliency.Provider
	EventSink      orchestrator.EventSink
	ComponentStore *compstore.ComponentStore

	// experimental feature
	// enabling this will use the cluster tasks backend for pending tasks, instead of the default local implementation
	// the cluster tasks backend uses actors to share the state of pending tasks
	// allowing to deploy multiple daprd replicas and expose them through a loadbalancer
	EnableClusteredDeployment bool

	// Enables a feature to make activities send their results to workflow when
	// the workflow is running on a different application. Useful when using
	// cross app workflows. Ensures that activities are not retried forever if
	// the workflow app is not available, and instead queues the result for when
	// the workflow app is back online. Strongly recommended to always be enabled
	// if using the same Dapr version on all daprds.
	WorkflowsRemoteActivityReminder bool

	RetentionPolicy *config.WorkflowStateRetentionPolicy
}

type PendingTasksBackend added in v1.16.0

type PendingTasksBackend interface {
	// CancelActivityTask implements backend.Backend.
	CancelActivityTask(ctx context.Context, instanceID api.InstanceID, taskID int32) error
	// CancelOrchestratorTask implements backend.Backend.
	CancelOrchestratorTask(ctx context.Context, instanceID api.InstanceID) error
	// CompleteActivityTask implements backend.Backend.
	CompleteActivityTask(ctx context.Context, response *protos.ActivityResponse) error
	// CompleteOrchestratorTask implements backend.Backend.
	CompleteOrchestratorTask(ctx context.Context, response *protos.OrchestratorResponse) error
	// WaitForActivityCompletion implements backend.Backend.
	WaitForActivityCompletion(request *protos.ActivityRequest) func(context.Context) (*protos.ActivityResponse, error)
	// WaitForOrchestratorCompletion implements backend.Backend.
	WaitForOrchestratorCompletion(request *protos.OrchestratorRequest) func(context.Context) (*protos.OrchestratorResponse, error)
}

Jump to

Keyboard shortcuts

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