Documentation
¶
Overview ¶
Code generated by protoc-gen-go_temporal. DO NOT EDIT. versions:
protoc-gen-go_temporal dev (latest) protoc (unknown)
source: example/mutex/v1/mutex.proto
Index ¶
- Constants
- Variables
- func Mutex(ctx workflow.Context, req *MutexInput, options ...*MutexActivityOptions) error
- func MutexChild(ctx workflow.Context, req *MutexInput, options ...*MutexChildOptions) error
- func MutexLocal(ctx workflow.Context, req *MutexInput, options ...*MutexLocalActivityOptions) error
- func NewExampleCli(options ...*ExampleCliOptions) (*v2.App, error)
- func NewExampleCliCommand(options ...*ExampleCliOptions) (*v2.Command, error)
- func NewExampleClientOptions() *exampleClientOptions
- func RegisterExampleActivities(r worker.ActivityRegistry, activities ExampleActivities)
- func RegisterExampleWorkflows(r worker.WorkflowRegistry, workflows ExampleWorkflows)
- func RegisterMutexActivity(r worker.ActivityRegistry, fn func(context.Context, *MutexInput) error)
- func RegisterMutexWorkflow(r worker.WorkflowRegistry, ...)
- func RegisterSampleWorkflowWithMutexWorkflow(r worker.WorkflowRegistry, ...)
- func ReleaseLockExternal(ctx workflow.Context, workflowID string, runID string, req *ReleaseLockInput) error
- func ReleaseLockExternalAsync(ctx workflow.Context, workflowID string, runID string, req *ReleaseLockInput) workflow.Future
- func SampleWorkflowWithMutexChild(ctx workflow.Context, req *SampleWorkflowWithMutexInput, ...) error
- func WithExampleSchemeTypes() scheme.Option
- type AcquireLockHandle
- type AcquireLockInput
- func (*AcquireLockInput) Descriptor() ([]byte, []int)deprecated
- func (x *AcquireLockInput) GetTimeout() *durationpb.Duration
- func (*AcquireLockInput) ProtoMessage()
- func (x *AcquireLockInput) ProtoReflect() protoreflect.Message
- func (x *AcquireLockInput) Reset()
- func (x *AcquireLockInput) String() string
- type AcquireLockOptions
- func (o *AcquireLockOptions) Build(workflowID string, runID string, req *AcquireLockInput) (opts *client.UpdateWorkflowOptions, err error)
- func (o *AcquireLockOptions) WithUpdateID(id string) *AcquireLockOptions
- func (o *AcquireLockOptions) WithUpdateWorkflowOptions(options client.UpdateWorkflowOptions) *AcquireLockOptions
- func (o *AcquireLockOptions) WithWaitPolicy(policy client.WorkflowUpdateStage) *AcquireLockOptions
- type AcquireLockOutput
- type ExampleActivities
- type ExampleCliOptions
- func (opts *ExampleCliOptions) WithAfter(fn func(*v2.Context) error) *ExampleCliOptions
- func (opts *ExampleCliOptions) WithBefore(fn func(*v2.Context) error) *ExampleCliOptions
- func (opts *ExampleCliOptions) WithClient(fn func(*v2.Context) (client.Client, error)) *ExampleCliOptions
- func (opts *ExampleCliOptions) WithWorker(fn func(*v2.Context, client.Client) (worker.Worker, error)) *ExampleCliOptions
- type ExampleClient
- type ExampleWorkflowFunctions
- type ExampleWorkflows
- type MutexActivityOptions
- func (o *MutexActivityOptions) Build(ctx workflow.Context) (workflow.Context, error)
- func (o *MutexActivityOptions) WithActivityOptions(options workflow.ActivityOptions) *MutexActivityOptions
- func (o *MutexActivityOptions) WithDataConverter(dc converter.DataConverter) *MutexActivityOptions
- func (o *MutexActivityOptions) WithHeartbeatTimeout(d time.Duration) *MutexActivityOptions
- func (o *MutexActivityOptions) WithRetryPolicy(policy *temporal.RetryPolicy) *MutexActivityOptions
- func (o *MutexActivityOptions) WithScheduleToCloseTimeout(d time.Duration) *MutexActivityOptions
- func (o *MutexActivityOptions) WithScheduleToStartTimeout(d time.Duration) *MutexActivityOptions
- func (o *MutexActivityOptions) WithStartToCloseTimeout(d time.Duration) *MutexActivityOptions
- func (o *MutexActivityOptions) WithTaskQueue(tq string) *MutexActivityOptions
- func (o *MutexActivityOptions) WithWaitForCancellation(wait bool) *MutexActivityOptions
- type MutexChildOptions
- func (o *MutexChildOptions) Build(ctx workflow.Context, req protoreflect.Message) (workflow.ChildWorkflowOptions, error)
- func (o *MutexChildOptions) WithChildWorkflowOptions(options workflow.ChildWorkflowOptions) *MutexChildOptions
- func (o *MutexChildOptions) WithDataConverter(dc converter.DataConverter) *MutexChildOptions
- func (o *MutexChildOptions) WithExecutionTimeout(d time.Duration) *MutexChildOptions
- func (o *MutexChildOptions) WithID(id string) *MutexChildOptions
- func (o *MutexChildOptions) WithIDReusePolicy(policy enumsv1.WorkflowIdReusePolicy) *MutexChildOptions
- func (o *MutexChildOptions) WithParentClosePolicy(policy enumsv1.ParentClosePolicy) *MutexChildOptions
- func (o *MutexChildOptions) WithRetryPolicy(policy *temporal.RetryPolicy) *MutexChildOptions
- func (o *MutexChildOptions) WithRunTimeout(d time.Duration) *MutexChildOptions
- func (o *MutexChildOptions) WithSearchAttributes(sa map[string]any) *MutexChildOptions
- func (o *MutexChildOptions) WithTaskQueue(tq string) *MutexChildOptions
- func (o *MutexChildOptions) WithTaskTimeout(d time.Duration) *MutexChildOptions
- func (o *MutexChildOptions) WithWaitForCancellation(wait bool) *MutexChildOptions
- func (o *MutexChildOptions) WithWorkflowIdConflictPolicy(policy enumsv1.WorkflowIdConflictPolicy) *MutexChildOptions
- type MutexChildRun
- func (r *MutexChildRun) Get(ctx workflow.Context) error
- func (r *MutexChildRun) ReleaseLock(ctx workflow.Context, input *ReleaseLockInput) error
- func (r *MutexChildRun) ReleaseLockAsync(ctx workflow.Context, input *ReleaseLockInput) workflow.Future
- func (r *MutexChildRun) Select(sel workflow.Selector, fn func(*MutexChildRun)) workflow.Selector
- func (r *MutexChildRun) SelectStart(sel workflow.Selector, fn func(*MutexChildRun)) workflow.Selector
- func (r *MutexChildRun) WaitStart(ctx workflow.Context) (*workflow.Execution, error)
- type MutexFuture
- type MutexInput
- type MutexLocalActivityOptions
- func (o *MutexLocalActivityOptions) Build(ctx workflow.Context) (workflow.Context, error)
- func (o *MutexLocalActivityOptions) Local(fn func(context.Context, *MutexInput) error) *MutexLocalActivityOptions
- func (o *MutexLocalActivityOptions) WithDataConverter(dc converter.DataConverter) *MutexLocalActivityOptions
- func (o *MutexLocalActivityOptions) WithLocalActivityOptions(options workflow.LocalActivityOptions) *MutexLocalActivityOptions
- func (o *MutexLocalActivityOptions) WithRetryPolicy(policy *temporal.RetryPolicy) *MutexLocalActivityOptions
- func (o *MutexLocalActivityOptions) WithScheduleToCloseTimeout(d time.Duration) *MutexLocalActivityOptions
- func (o *MutexLocalActivityOptions) WithStartToCloseTimeout(d time.Duration) *MutexLocalActivityOptions
- type MutexOptions
- func (o *MutexOptions) Build(req protoreflect.Message) (client.StartWorkflowOptions, error)
- func (o *MutexOptions) WithExecutionTimeout(d time.Duration) *MutexOptions
- func (o *MutexOptions) WithID(id string) *MutexOptions
- func (o *MutexOptions) WithIDReusePolicy(policy enumsv1.WorkflowIdReusePolicy) *MutexOptions
- func (o *MutexOptions) WithRetryPolicy(policy *temporal.RetryPolicy) *MutexOptions
- func (o *MutexOptions) WithRunTimeout(d time.Duration) *MutexOptions
- func (o *MutexOptions) WithSearchAttributes(sa map[string]any) *MutexOptions
- func (o *MutexOptions) WithStartWorkflowOptions(options client.StartWorkflowOptions) *MutexOptions
- func (o *MutexOptions) WithTaskQueue(tq string) *MutexOptions
- func (o *MutexOptions) WithTaskTimeout(d time.Duration) *MutexOptions
- func (o *MutexOptions) WithWorkflowIdConflictPolicy(policy enumsv1.WorkflowIdConflictPolicy) *MutexOptions
- type MutexRun
- type MutexWithAcquireLockOptions
- func (o *MutexWithAcquireLockOptions) Build(ctx context.Context, ...) (options client.UpdateWithStartWorkflowOptions, err error)
- func (o *MutexWithAcquireLockOptions) WithAcquireLockOptions(options *AcquireLockOptions) *MutexWithAcquireLockOptions
- func (o *MutexWithAcquireLockOptions) WithMutexOptions(options *MutexOptions) *MutexWithAcquireLockOptions
- func (o *MutexWithAcquireLockOptions) WithUpdateWithStartWorkflowOptions(options client.UpdateWithStartWorkflowOptions) *MutexWithAcquireLockOptions
- type MutexWorkflow
- type MutexWorkflowInput
- type ReleaseLockInput
- type ReleaseLockSignal
- func (s *ReleaseLockSignal) Receive(ctx workflow.Context) (*ReleaseLockInput, bool)
- func (s *ReleaseLockSignal) ReceiveAsync() *ReleaseLockInput
- func (s *ReleaseLockSignal) ReceiveWithTimeout(ctx workflow.Context, timeout time.Duration) (resp *ReleaseLockInput, ok bool, more bool)
- func (s *ReleaseLockSignal) Select(sel workflow.Selector, fn func(*ReleaseLockInput)) workflow.Selector
- type SampleWorkflowWithMutexChildOptions
- func (o *SampleWorkflowWithMutexChildOptions) Build(ctx workflow.Context, req protoreflect.Message) (workflow.ChildWorkflowOptions, error)
- func (o *SampleWorkflowWithMutexChildOptions) WithChildWorkflowOptions(options workflow.ChildWorkflowOptions) *SampleWorkflowWithMutexChildOptions
- func (o *SampleWorkflowWithMutexChildOptions) WithDataConverter(dc converter.DataConverter) *SampleWorkflowWithMutexChildOptions
- func (o *SampleWorkflowWithMutexChildOptions) WithExecutionTimeout(d time.Duration) *SampleWorkflowWithMutexChildOptions
- func (o *SampleWorkflowWithMutexChildOptions) WithID(id string) *SampleWorkflowWithMutexChildOptions
- func (o *SampleWorkflowWithMutexChildOptions) WithIDReusePolicy(policy enumsv1.WorkflowIdReusePolicy) *SampleWorkflowWithMutexChildOptions
- func (o *SampleWorkflowWithMutexChildOptions) WithParentClosePolicy(policy enumsv1.ParentClosePolicy) *SampleWorkflowWithMutexChildOptions
- func (o *SampleWorkflowWithMutexChildOptions) WithRetryPolicy(policy *temporal.RetryPolicy) *SampleWorkflowWithMutexChildOptions
- func (o *SampleWorkflowWithMutexChildOptions) WithRunTimeout(d time.Duration) *SampleWorkflowWithMutexChildOptions
- func (o *SampleWorkflowWithMutexChildOptions) WithSearchAttributes(sa map[string]any) *SampleWorkflowWithMutexChildOptions
- func (o *SampleWorkflowWithMutexChildOptions) WithTaskQueue(tq string) *SampleWorkflowWithMutexChildOptions
- func (o *SampleWorkflowWithMutexChildOptions) WithTaskTimeout(d time.Duration) *SampleWorkflowWithMutexChildOptions
- func (o *SampleWorkflowWithMutexChildOptions) WithWaitForCancellation(wait bool) *SampleWorkflowWithMutexChildOptions
- func (o *SampleWorkflowWithMutexChildOptions) WithWorkflowIdConflictPolicy(policy enumsv1.WorkflowIdConflictPolicy) *SampleWorkflowWithMutexChildOptions
- type SampleWorkflowWithMutexChildRun
- func (r *SampleWorkflowWithMutexChildRun) Get(ctx workflow.Context) error
- func (r *SampleWorkflowWithMutexChildRun) Select(sel workflow.Selector, fn func(*SampleWorkflowWithMutexChildRun)) workflow.Selector
- func (r *SampleWorkflowWithMutexChildRun) SelectStart(sel workflow.Selector, fn func(*SampleWorkflowWithMutexChildRun)) workflow.Selector
- func (r *SampleWorkflowWithMutexChildRun) WaitStart(ctx workflow.Context) (*workflow.Execution, error)
- type SampleWorkflowWithMutexInput
- func (*SampleWorkflowWithMutexInput) Descriptor() ([]byte, []int)deprecated
- func (x *SampleWorkflowWithMutexInput) GetResourceId() string
- func (x *SampleWorkflowWithMutexInput) GetSleep() *durationpb.Duration
- func (*SampleWorkflowWithMutexInput) ProtoMessage()
- func (x *SampleWorkflowWithMutexInput) ProtoReflect() protoreflect.Message
- func (x *SampleWorkflowWithMutexInput) Reset()
- func (x *SampleWorkflowWithMutexInput) String() string
- type SampleWorkflowWithMutexOptions
- func (o *SampleWorkflowWithMutexOptions) Build(req protoreflect.Message) (client.StartWorkflowOptions, error)
- func (o *SampleWorkflowWithMutexOptions) WithExecutionTimeout(d time.Duration) *SampleWorkflowWithMutexOptions
- func (o *SampleWorkflowWithMutexOptions) WithID(id string) *SampleWorkflowWithMutexOptions
- func (o *SampleWorkflowWithMutexOptions) WithIDReusePolicy(policy enumsv1.WorkflowIdReusePolicy) *SampleWorkflowWithMutexOptions
- func (o *SampleWorkflowWithMutexOptions) WithRetryPolicy(policy *temporal.RetryPolicy) *SampleWorkflowWithMutexOptions
- func (o *SampleWorkflowWithMutexOptions) WithRunTimeout(d time.Duration) *SampleWorkflowWithMutexOptions
- func (o *SampleWorkflowWithMutexOptions) WithSearchAttributes(sa map[string]any) *SampleWorkflowWithMutexOptions
- func (o *SampleWorkflowWithMutexOptions) WithStartWorkflowOptions(options client.StartWorkflowOptions) *SampleWorkflowWithMutexOptions
- func (o *SampleWorkflowWithMutexOptions) WithTaskQueue(tq string) *SampleWorkflowWithMutexOptions
- func (o *SampleWorkflowWithMutexOptions) WithTaskTimeout(d time.Duration) *SampleWorkflowWithMutexOptions
- func (o *SampleWorkflowWithMutexOptions) WithWorkflowIdConflictPolicy(policy enumsv1.WorkflowIdConflictPolicy) *SampleWorkflowWithMutexOptions
- type SampleWorkflowWithMutexRun
- type SampleWorkflowWithMutexWorkflow
- type SampleWorkflowWithMutexWorkflowInput
- type TestExampleClient
- func (c *TestExampleClient) AcquireLock(ctx context.Context, workflowID string, runID string, req *AcquireLockInput, ...) (*AcquireLockOutput, error)
- func (c *TestExampleClient) AcquireLockAsync(ctx context.Context, workflowID string, runID string, req *AcquireLockInput, ...) (AcquireLockHandle, error)
- func (c *TestExampleClient) CancelWorkflow(ctx context.Context, workflowID string, runID string) error
- func (c *TestExampleClient) GetAcquireLock(ctx context.Context, req client.GetWorkflowUpdateHandleOptions) (AcquireLockHandle, error)
- func (c *TestExampleClient) GetMutex(ctx context.Context, workflowID string, runID string) MutexRun
- func (c *TestExampleClient) GetSampleWorkflowWithMutex(ctx context.Context, workflowID string, runID string) SampleWorkflowWithMutexRun
- func (c *TestExampleClient) Mutex(ctx context.Context, req *MutexInput, opts ...*MutexOptions) error
- func (c *TestExampleClient) MutexAsync(ctx context.Context, req *MutexInput, options ...*MutexOptions) (MutexRun, error)
- func (c *TestExampleClient) MutexWithAcquireLock(ctx context.Context, input *MutexInput, update *AcquireLockInput, ...) (*AcquireLockOutput, MutexRun, error)
- func (c *TestExampleClient) MutexWithAcquireLockAsync(ctx context.Context, input *MutexInput, update *AcquireLockInput, ...) (AcquireLockHandle, MutexRun, error)
- func (c *TestExampleClient) ReleaseLock(ctx context.Context, workflowID string, runID string, req *ReleaseLockInput) error
- func (c *TestExampleClient) SampleWorkflowWithMutex(ctx context.Context, req *SampleWorkflowWithMutexInput, ...) error
- func (c *TestExampleClient) SampleWorkflowWithMutexAsync(ctx context.Context, req *SampleWorkflowWithMutexInput, ...) (SampleWorkflowWithMutexRun, error)
- func (c *TestExampleClient) TerminateWorkflow(ctx context.Context, workflowID string, runID string, reason string, ...) error
Constants ¶
const ( MutexWorkflowName = "mutex.v1.Mutex" SampleWorkflowWithMutexWorkflowName = "example.mutex.v1.Example.SampleWorkflowWithMutex" )
example.mutex.v1.Example workflow names
const (
AcquireLockUpdateName = "mutex.v1.AcquireLock"
)
example.mutex.v1.Example update names
const (
MutexActivityName = "example.mutex.v1.Example.Mutex"
)
example.mutex.v1.Example activity names
const (
ReleaseLockSignalName = "mutex.v1.ReleaseLock"
)
example.mutex.v1.Example signal names
Variables ¶
var ( MutexIdexpression = expression.MustParseExpression("mutex:${! resourceId }") SampleWorkflowWithMutexIdexpression = expression.MustParseExpression("SampleWorkflow1WithMutex_${! uuid_v4() }") )
example.mutex.v1.Example workflow id expressions
var ( // Mutex is a workflow that manages concurrent access to a resource // identified by `resource_id`. MutexFunction func(workflow.Context, *MutexInput) error // SampleWorkflowWithMutex is a sample workflow that demonstrates how to // use the Mutex service. SampleWorkflowWithMutexFunction func(workflow.Context, *SampleWorkflowWithMutexInput) error )
Reference to generated workflow functions
var ExampleTaskQueue = "mutex"
ExampleTaskQueue is the default task-queue for a example.mutex.v1.Example worker
var File_example_mutex_v1_mutex_proto protoreflect.FileDescriptor
Functions ¶
func Mutex ¶
func Mutex(ctx workflow.Context, req *MutexInput, options ...*MutexActivityOptions) error
Mutex is a workflow that manages concurrent access to a resource identified by `resource_id`.
func MutexChild ¶
func MutexChild(ctx workflow.Context, req *MutexInput, options ...*MutexChildOptions) error
Mutex is a workflow that manages concurrent access to a resource identified by `resource_id`.
func MutexLocal ¶
func MutexLocal(ctx workflow.Context, req *MutexInput, options ...*MutexLocalActivityOptions) error
Mutex is a workflow that manages concurrent access to a resource identified by `resource_id`.
func NewExampleCli ¶
func NewExampleCli(options ...*ExampleCliOptions) (*v2.App, error)
NewExampleCli initializes a cli for a(n) example.mutex.v1.Example service
func NewExampleCliCommand ¶
func NewExampleCliCommand(options ...*ExampleCliOptions) (*v2.Command, error)
NewExampleCliCommand initializes a cli command for a example.mutex.v1.Example service with subcommands for each query, signal, update, and workflow
func NewExampleClientOptions ¶
func NewExampleClientOptions() *exampleClientOptions
NewExampleClientOptions initializes a new exampleClientOptions value
func RegisterExampleActivities ¶
func RegisterExampleActivities(r worker.ActivityRegistry, activities ExampleActivities)
RegisterExampleActivities registers activities with a worker
func RegisterExampleWorkflows ¶
func RegisterExampleWorkflows(r worker.WorkflowRegistry, workflows ExampleWorkflows)
RegisterExampleWorkflows registers example.mutex.v1.Example workflows with the given worker
func RegisterMutexActivity ¶
func RegisterMutexActivity(r worker.ActivityRegistry, fn func(context.Context, *MutexInput) error)
RegisterMutexActivity registers a example.mutex.v1.Example.Mutex activity
func RegisterMutexWorkflow ¶
func RegisterMutexWorkflow(r worker.WorkflowRegistry, wf func(workflow.Context, *MutexWorkflowInput) (MutexWorkflow, error))
RegisterMutexWorkflow registers a example.mutex.v1.Example.Mutex workflow with the given worker
func RegisterSampleWorkflowWithMutexWorkflow ¶
func RegisterSampleWorkflowWithMutexWorkflow(r worker.WorkflowRegistry, wf func(workflow.Context, *SampleWorkflowWithMutexWorkflowInput) (SampleWorkflowWithMutexWorkflow, error))
RegisterSampleWorkflowWithMutexWorkflow registers a example.mutex.v1.Example.SampleWorkflowWithMutex workflow with the given worker
func ReleaseLockExternal ¶
func ReleaseLockExternal(ctx workflow.Context, workflowID string, runID string, req *ReleaseLockInput) error
ReleaseLock releases a lock on a resource identified by `lease_id`.
func ReleaseLockExternalAsync ¶
func ReleaseLockExternalAsync(ctx workflow.Context, workflowID string, runID string, req *ReleaseLockInput) workflow.Future
ReleaseLock releases a lock on a resource identified by `lease_id`.
func SampleWorkflowWithMutexChild ¶
func SampleWorkflowWithMutexChild(ctx workflow.Context, req *SampleWorkflowWithMutexInput, options ...*SampleWorkflowWithMutexChildOptions) error
SampleWorkflowWithMutex is a sample workflow that demonstrates how to use the Mutex service.
func WithExampleSchemeTypes ¶
WithExampleSchemeTypes registers all Example protobuf types with the given scheme
Types ¶
type AcquireLockHandle ¶ added in v1.17.0
type AcquireLockHandle interface { // WorkflowID returns the workflow ID WorkflowID() string // RunID returns the workflow instance ID RunID() string // UpdateID returns the update ID UpdateID() string // Get blocks until the workflow is complete and returns the result Get(ctx context.Context) (*AcquireLockOutput, error) }
AcquireLockHandle describes a(n) mutex.v1.AcquireLock update handle
type AcquireLockInput ¶
type AcquireLockInput struct { Timeout *durationpb.Duration `protobuf:"bytes,1,opt,name=timeout,proto3" json:"timeout,omitempty"` // contains filtered or unexported fields }
func UnmarshalCliFlagsToAcquireLockInput ¶
func UnmarshalCliFlagsToAcquireLockInput(cmd *v2.Context, options ...helpers.UnmarshalCliFlagsOptions) (*AcquireLockInput, error)
UnmarshalCliFlagsToAcquireLockInput unmarshals a AcquireLockInput from command line flags
func (*AcquireLockInput) Descriptor
deprecated
func (*AcquireLockInput) Descriptor() ([]byte, []int)
Deprecated: Use AcquireLockInput.ProtoReflect.Descriptor instead.
func (*AcquireLockInput) GetTimeout ¶
func (x *AcquireLockInput) GetTimeout() *durationpb.Duration
func (*AcquireLockInput) ProtoMessage ¶
func (*AcquireLockInput) ProtoMessage()
func (*AcquireLockInput) ProtoReflect ¶
func (x *AcquireLockInput) ProtoReflect() protoreflect.Message
func (*AcquireLockInput) Reset ¶
func (x *AcquireLockInput) Reset()
func (*AcquireLockInput) String ¶
func (x *AcquireLockInput) String() string
type AcquireLockOptions ¶ added in v1.17.0
type AcquireLockOptions struct { Options *client.UpdateWorkflowOptions // contains filtered or unexported fields }
AcquireLockOptions provides configuration for a mutex.v1.AcquireLock update operation
func NewAcquireLockOptions ¶ added in v1.17.0
func NewAcquireLockOptions() *AcquireLockOptions
NewAcquireLockOptions initializes a new AcquireLockOptions value
func (*AcquireLockOptions) Build ¶ added in v1.17.0
func (o *AcquireLockOptions) Build(workflowID string, runID string, req *AcquireLockInput) (opts *client.UpdateWorkflowOptions, err error)
Build initializes a new client.UpdateWorkflowOptions with defaults and overrides applied
func (*AcquireLockOptions) WithUpdateID ¶ added in v1.17.0
func (o *AcquireLockOptions) WithUpdateID(id string) *AcquireLockOptions
WithUpdateID sets the UpdateID
func (*AcquireLockOptions) WithUpdateWorkflowOptions ¶ added in v1.17.0
func (o *AcquireLockOptions) WithUpdateWorkflowOptions(options client.UpdateWorkflowOptions) *AcquireLockOptions
WithUpdateWorkflowOptions sets the initial client.UpdateWorkflowOptions
func (*AcquireLockOptions) WithWaitPolicy ¶ added in v1.17.0
func (o *AcquireLockOptions) WithWaitPolicy(policy client.WorkflowUpdateStage) *AcquireLockOptions
WithWaitPolicy sets the WaitPolicy
type AcquireLockOutput ¶ added in v1.17.0
type AcquireLockOutput struct { LeaseId string `protobuf:"bytes,1,opt,name=lease_id,json=leaseId,proto3" json:"lease_id,omitempty"` // contains filtered or unexported fields }
func (*AcquireLockOutput) Descriptor
deprecated
added in
v1.17.0
func (*AcquireLockOutput) Descriptor() ([]byte, []int)
Deprecated: Use AcquireLockOutput.ProtoReflect.Descriptor instead.
func (*AcquireLockOutput) GetLeaseId ¶ added in v1.17.0
func (x *AcquireLockOutput) GetLeaseId() string
func (*AcquireLockOutput) ProtoMessage ¶ added in v1.17.0
func (*AcquireLockOutput) ProtoMessage()
func (*AcquireLockOutput) ProtoReflect ¶ added in v1.17.0
func (x *AcquireLockOutput) ProtoReflect() protoreflect.Message
func (*AcquireLockOutput) Reset ¶ added in v1.17.0
func (x *AcquireLockOutput) Reset()
func (*AcquireLockOutput) String ¶ added in v1.17.0
func (x *AcquireLockOutput) String() string
type ExampleActivities ¶
type ExampleActivities interface { // Mutex is a workflow that manages concurrent access to a resource // identified by `resource_id`. Mutex(ctx context.Context, req *MutexInput) error }
ExampleActivities describes available worker activities
type ExampleCliOptions ¶
type ExampleCliOptions struct {
// contains filtered or unexported fields
}
ExampleCliOptions describes runtime configuration for example.mutex.v1.Example cli
func NewExampleCliOptions ¶
func NewExampleCliOptions() *ExampleCliOptions
NewExampleCliOptions initializes a new ExampleCliOptions value
func (*ExampleCliOptions) WithAfter ¶
func (opts *ExampleCliOptions) WithAfter(fn func(*v2.Context) error) *ExampleCliOptions
WithAfter injects a custom After hook to be run after any command invocation
func (*ExampleCliOptions) WithBefore ¶
func (opts *ExampleCliOptions) WithBefore(fn func(*v2.Context) error) *ExampleCliOptions
WithBefore injects a custom Before hook to be run prior to any command invocation
func (*ExampleCliOptions) WithClient ¶
func (opts *ExampleCliOptions) WithClient(fn func(*v2.Context) (client.Client, error)) *ExampleCliOptions
WithClient provides a Temporal client factory for use by commands
func (*ExampleCliOptions) WithWorker ¶
func (opts *ExampleCliOptions) WithWorker(fn func(*v2.Context, client.Client) (worker.Worker, error)) *ExampleCliOptions
WithWorker provides an method for initializing a worker
type ExampleClient ¶
type ExampleClient interface { // Mutex is a workflow that manages concurrent access to a resource // identified by `resource_id`. Mutex(ctx context.Context, req *MutexInput, opts ...*MutexOptions) error // MutexAsync starts a(n) mutex.v1.Mutex workflow and returns a handle to the workflow run MutexAsync(ctx context.Context, req *MutexInput, opts ...*MutexOptions) (MutexRun, error) // GetMutex retrieves a handle to an existing mutex.v1.Mutex workflow execution GetMutex(ctx context.Context, workflowID string, runID string) MutexRun // MutexWithAcquireLock executes a(n) mutex.v1.AcquireLock update on a(n) mutex.v1.Mutex workflow, starting it if necessary, and blocks until update completion MutexWithAcquireLock(ctx context.Context, req *MutexInput, update *AcquireLockInput, opts ...*MutexWithAcquireLockOptions) (*AcquireLockOutput, MutexRun, error) // MutexWithAcquireLockAsync starts a(n) mutex.v1.AcquireLock update on a(n) mutex.v1.Mutex workflow, starting it if necessary, and returns a handle to the update execution MutexWithAcquireLockAsync(ctx context.Context, req *MutexInput, update *AcquireLockInput, opts ...*MutexWithAcquireLockOptions) (AcquireLockHandle, MutexRun, error) // SampleWorkflowWithMutex is a sample workflow that demonstrates how to // use the Mutex service. SampleWorkflowWithMutex(ctx context.Context, req *SampleWorkflowWithMutexInput, opts ...*SampleWorkflowWithMutexOptions) error // SampleWorkflowWithMutexAsync starts a(n) example.mutex.v1.Example.SampleWorkflowWithMutex workflow and returns a handle to the workflow run SampleWorkflowWithMutexAsync(ctx context.Context, req *SampleWorkflowWithMutexInput, opts ...*SampleWorkflowWithMutexOptions) (SampleWorkflowWithMutexRun, error) // GetSampleWorkflowWithMutex retrieves a handle to an existing example.mutex.v1.Example.SampleWorkflowWithMutex workflow execution GetSampleWorkflowWithMutex(ctx context.Context, workflowID string, runID string) SampleWorkflowWithMutexRun // CancelWorkflow requests cancellation of an existing workflow execution CancelWorkflow(ctx context.Context, workflowID string, runID string) error // TerminateWorkflow an existing workflow execution TerminateWorkflow(ctx context.Context, workflowID string, runID string, reason string, details ...interface{}) error // ReleaseLock releases a lock on a resource identified by `lease_id`. ReleaseLock(ctx context.Context, workflowID string, runID string, signal *ReleaseLockInput) error // AcquireLock requests a lock on a resource identified by `resource_id` // and blocks until the lock is acquired, returning a `lease_id` that // can be used to release the lock. AcquireLock(ctx context.Context, workflowID string, runID string, req *AcquireLockInput, opts ...*AcquireLockOptions) (*AcquireLockOutput, error) // AcquireLockAsync starts a(n) mutex.v1.AcquireLock update and returns a handle to the workflow update AcquireLockAsync(ctx context.Context, workflowID string, runID string, req *AcquireLockInput, opts ...*AcquireLockOptions) (AcquireLockHandle, error) // GetAcquireLock retrieves a handle to an existing mutex.v1.AcquireLock update GetAcquireLock(ctx context.Context, req client.GetWorkflowUpdateHandleOptions) (AcquireLockHandle, error) }
ExampleClient describes a client for a(n) example.mutex.v1.Example worker
func NewExampleClient ¶
func NewExampleClient(c client.Client, options ...*exampleClientOptions) ExampleClient
NewExampleClient initializes a new example.mutex.v1.Example client
func NewExampleClientWithOptions ¶
func NewExampleClientWithOptions(c client.Client, opts client.Options, options ...*exampleClientOptions) (ExampleClient, error)
NewExampleClientWithOptions initializes a new Example client with the given options
type ExampleWorkflowFunctions ¶ added in v1.12.0
type ExampleWorkflowFunctions interface { // Mutex is a workflow that manages concurrent access to a resource // identified by `resource_id`. Mutex(workflow.Context, *MutexInput) error // SampleWorkflowWithMutex is a sample workflow that demonstrates how to // use the Mutex service. SampleWorkflowWithMutex(workflow.Context, *SampleWorkflowWithMutexInput) error }
ExampleWorkflowFunctions describes a mockable dependency for inlining workflows within other workflows
func NewExampleWorkflowFunctions ¶ added in v1.12.0
func NewExampleWorkflowFunctions() ExampleWorkflowFunctions
type ExampleWorkflows ¶
type ExampleWorkflows interface { // Mutex is a workflow that manages concurrent access to a resource // identified by `resource_id`. Mutex(ctx workflow.Context, input *MutexWorkflowInput) (MutexWorkflow, error) // SampleWorkflowWithMutex is a sample workflow that demonstrates how to // use the Mutex service. SampleWorkflowWithMutex(ctx workflow.Context, input *SampleWorkflowWithMutexWorkflowInput) (SampleWorkflowWithMutexWorkflow, error) }
ExampleWorkflows provides methods for initializing new example.mutex.v1.Example workflow values
type MutexActivityOptions ¶
type MutexActivityOptions struct {
// contains filtered or unexported fields
}
MutexActivityOptions provides configuration for a(n) example.mutex.v1.Example.Mutex activity
func NewMutexActivityOptions ¶
func NewMutexActivityOptions() *MutexActivityOptions
NewMutexActivityOptions initializes a new MutexActivityOptions value
func (*MutexActivityOptions) Build ¶ added in v1.13.0
Build initializes a workflow.Context with appropriate ActivityOptions values derived from schema defaults and any user-defined overrides
func (*MutexActivityOptions) WithActivityOptions ¶
func (o *MutexActivityOptions) WithActivityOptions(options workflow.ActivityOptions) *MutexActivityOptions
WithActivityOptions specifies an initial ActivityOptions value to which defaults will be applied
func (*MutexActivityOptions) WithDataConverter ¶ added in v1.17.0
func (o *MutexActivityOptions) WithDataConverter(dc converter.DataConverter) *MutexActivityOptions
WithDataConverter registers a DataConverter for the (local) activity
func (*MutexActivityOptions) WithHeartbeatTimeout ¶ added in v1.13.0
func (o *MutexActivityOptions) WithHeartbeatTimeout(d time.Duration) *MutexActivityOptions
WithHeartbeatTimeout sets the HeartbeatTimeout value
func (*MutexActivityOptions) WithRetryPolicy ¶ added in v1.13.0
func (o *MutexActivityOptions) WithRetryPolicy(policy *temporal.RetryPolicy) *MutexActivityOptions
WithRetryPolicy sets the RetryPolicy value
func (*MutexActivityOptions) WithScheduleToCloseTimeout ¶ added in v1.13.0
func (o *MutexActivityOptions) WithScheduleToCloseTimeout(d time.Duration) *MutexActivityOptions
WithScheduleToCloseTimeout sets the ScheduleToCloseTimeout value
func (*MutexActivityOptions) WithScheduleToStartTimeout ¶ added in v1.13.0
func (o *MutexActivityOptions) WithScheduleToStartTimeout(d time.Duration) *MutexActivityOptions
WithScheduleToStartTimeout sets the ScheduleToStartTimeout value
func (*MutexActivityOptions) WithStartToCloseTimeout ¶ added in v1.13.0
func (o *MutexActivityOptions) WithStartToCloseTimeout(d time.Duration) *MutexActivityOptions
WithStartToCloseTimeout sets the StartToCloseTimeout value
func (*MutexActivityOptions) WithTaskQueue ¶ added in v1.13.0
func (o *MutexActivityOptions) WithTaskQueue(tq string) *MutexActivityOptions
WithTaskQueue sets the TaskQueue value
func (*MutexActivityOptions) WithWaitForCancellation ¶ added in v1.13.0
func (o *MutexActivityOptions) WithWaitForCancellation(wait bool) *MutexActivityOptions
WithWaitForCancellation sets the WaitForCancellation value
type MutexChildOptions ¶
type MutexChildOptions struct {
// contains filtered or unexported fields
}
MutexChildOptions provides configuration for a child mutex.v1.Mutex workflow operation
func NewMutexChildOptions ¶
func NewMutexChildOptions() *MutexChildOptions
NewMutexChildOptions initializes a new MutexChildOptions value
func (*MutexChildOptions) Build ¶ added in v1.13.0
func (o *MutexChildOptions) Build(ctx workflow.Context, req protoreflect.Message) (workflow.ChildWorkflowOptions, error)
Build initializes a new go.temporal.io/sdk/workflow.ChildWorkflowOptions value with defaults and overrides applied
func (*MutexChildOptions) WithChildWorkflowOptions ¶
func (o *MutexChildOptions) WithChildWorkflowOptions(options workflow.ChildWorkflowOptions) *MutexChildOptions
WithChildWorkflowOptions sets the initial go.temporal.io/sdk/workflow.ChildWorkflowOptions
func (*MutexChildOptions) WithDataConverter ¶ added in v1.17.0
func (o *MutexChildOptions) WithDataConverter(dc converter.DataConverter) *MutexChildOptions
WithDataConverter registers a DataConverter for the child workflow
func (*MutexChildOptions) WithExecutionTimeout ¶ added in v1.13.0
func (o *MutexChildOptions) WithExecutionTimeout(d time.Duration) *MutexChildOptions
WithExecutionTimeout sets the WorkflowExecutionTimeout value
func (*MutexChildOptions) WithID ¶ added in v1.13.0
func (o *MutexChildOptions) WithID(id string) *MutexChildOptions
WithID sets the WorkflowID value
func (*MutexChildOptions) WithIDReusePolicy ¶ added in v1.13.0
func (o *MutexChildOptions) WithIDReusePolicy(policy enumsv1.WorkflowIdReusePolicy) *MutexChildOptions
WithIDReusePolicy sets the WorkflowIDReusePolicy value
func (*MutexChildOptions) WithParentClosePolicy ¶ added in v1.13.0
func (o *MutexChildOptions) WithParentClosePolicy(policy enumsv1.ParentClosePolicy) *MutexChildOptions
WithParentClosePolicy sets the WorkflowIDReusePolicy value
func (*MutexChildOptions) WithRetryPolicy ¶ added in v1.13.0
func (o *MutexChildOptions) WithRetryPolicy(policy *temporal.RetryPolicy) *MutexChildOptions
WithRetryPolicy sets the RetryPolicy value
func (*MutexChildOptions) WithRunTimeout ¶ added in v1.13.0
func (o *MutexChildOptions) WithRunTimeout(d time.Duration) *MutexChildOptions
WithRunTimeout sets the WorkflowRunTimeout value
func (*MutexChildOptions) WithSearchAttributes ¶ added in v1.13.0
func (o *MutexChildOptions) WithSearchAttributes(sa map[string]any) *MutexChildOptions
WithSearchAttributes sets the SearchAttributes value
func (*MutexChildOptions) WithTaskQueue ¶ added in v1.13.0
func (o *MutexChildOptions) WithTaskQueue(tq string) *MutexChildOptions
WithTaskQueue sets the TaskQueue value
func (*MutexChildOptions) WithTaskTimeout ¶ added in v1.13.0
func (o *MutexChildOptions) WithTaskTimeout(d time.Duration) *MutexChildOptions
WithTaskTimeout sets the WorkflowTaskTimeout value
func (*MutexChildOptions) WithWaitForCancellation ¶ added in v1.13.0
func (o *MutexChildOptions) WithWaitForCancellation(wait bool) *MutexChildOptions
WithWaitForCancellation sets the WaitForCancellation value
func (*MutexChildOptions) WithWorkflowIdConflictPolicy ¶ added in v1.17.0
func (o *MutexChildOptions) WithWorkflowIdConflictPolicy(policy enumsv1.WorkflowIdConflictPolicy) *MutexChildOptions
WithWorkflowIdConflictPolicy sets the WorkflowIdConflictPolicy value
type MutexChildRun ¶
type MutexChildRun struct {
Future workflow.ChildWorkflowFuture
}
MutexChildRun describes a child Mutex workflow run
func MutexChildAsync ¶
func MutexChildAsync(ctx workflow.Context, req *MutexInput, options ...*MutexChildOptions) (*MutexChildRun, error)
Mutex is a workflow that manages concurrent access to a resource identified by `resource_id`.
func (*MutexChildRun) Get ¶
func (r *MutexChildRun) Get(ctx workflow.Context) error
Get blocks until the workflow is completed, returning the response value
func (*MutexChildRun) ReleaseLock ¶
func (r *MutexChildRun) ReleaseLock(ctx workflow.Context, input *ReleaseLockInput) error
ReleaseLock sends a(n) "mutex.v1.ReleaseLock" signal request to the child workflow
func (*MutexChildRun) ReleaseLockAsync ¶
func (r *MutexChildRun) ReleaseLockAsync(ctx workflow.Context, input *ReleaseLockInput) workflow.Future
ReleaseLockAsync sends a(n) "mutex.v1.ReleaseLock" signal request to the child workflow
func (*MutexChildRun) Select ¶
func (r *MutexChildRun) Select(sel workflow.Selector, fn func(*MutexChildRun)) workflow.Selector
Select adds this completion to the selector. Callback can be nil.
func (*MutexChildRun) SelectStart ¶
func (r *MutexChildRun) SelectStart(sel workflow.Selector, fn func(*MutexChildRun)) workflow.Selector
SelectStart adds waiting for start to the selector. Callback can be nil.
type MutexFuture ¶
MutexFuture describes a(n) example.mutex.v1.Example.Mutex activity execution
func MutexAsync ¶
func MutexAsync(ctx workflow.Context, req *MutexInput, options ...*MutexActivityOptions) *MutexFuture
Mutex is a workflow that manages concurrent access to a resource identified by `resource_id`.
func MutexLocalAsync ¶
func MutexLocalAsync(ctx workflow.Context, req *MutexInput, options ...*MutexLocalActivityOptions) *MutexFuture
Mutex is a workflow that manages concurrent access to a resource identified by `resource_id`.
func (*MutexFuture) Get ¶
func (f *MutexFuture) Get(ctx workflow.Context) error
Get blocks on the activity's completion, returning the response
func (*MutexFuture) Select ¶
func (f *MutexFuture) Select(sel workflow.Selector, fn func(*MutexFuture)) workflow.Selector
Select adds the activity's completion to the selector, callback can be nil
type MutexInput ¶
type MutexInput struct { ResourceId string `protobuf:"bytes,1,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` // contains filtered or unexported fields }
func UnmarshalCliFlagsToMutexInput ¶
func UnmarshalCliFlagsToMutexInput(cmd *v2.Context, options ...helpers.UnmarshalCliFlagsOptions) (*MutexInput, error)
UnmarshalCliFlagsToMutexInput unmarshals a MutexInput from command line flags
func (*MutexInput) Descriptor
deprecated
func (*MutexInput) Descriptor() ([]byte, []int)
Deprecated: Use MutexInput.ProtoReflect.Descriptor instead.
func (*MutexInput) GetResourceId ¶
func (x *MutexInput) GetResourceId() string
func (*MutexInput) ProtoMessage ¶
func (*MutexInput) ProtoMessage()
func (*MutexInput) ProtoReflect ¶
func (x *MutexInput) ProtoReflect() protoreflect.Message
func (*MutexInput) Reset ¶
func (x *MutexInput) Reset()
func (*MutexInput) String ¶
func (x *MutexInput) String() string
type MutexLocalActivityOptions ¶
type MutexLocalActivityOptions struct {
// contains filtered or unexported fields
}
MutexLocalActivityOptions provides configuration for a(n) example.mutex.v1.Example.Mutex activity
func NewMutexLocalActivityOptions ¶
func NewMutexLocalActivityOptions() *MutexLocalActivityOptions
NewMutexLocalActivityOptions initializes a new MutexLocalActivityOptions value
func (*MutexLocalActivityOptions) Build ¶ added in v1.13.0
Build initializes a workflow.Context with appropriate LocalActivityOptions values derived from schema defaults and any user-defined overrides
func (*MutexLocalActivityOptions) Local ¶
func (o *MutexLocalActivityOptions) Local(fn func(context.Context, *MutexInput) error) *MutexLocalActivityOptions
Local specifies a custom example.mutex.v1.Example.Mutex implementation
func (*MutexLocalActivityOptions) WithDataConverter ¶ added in v1.17.0
func (o *MutexLocalActivityOptions) WithDataConverter(dc converter.DataConverter) *MutexLocalActivityOptions
WithDataConverter registers a DataConverter for the (local) activity
func (*MutexLocalActivityOptions) WithLocalActivityOptions ¶
func (o *MutexLocalActivityOptions) WithLocalActivityOptions(options workflow.LocalActivityOptions) *MutexLocalActivityOptions
WithLocalActivityOptions specifies an initial LocalActivityOptions value to which defaults will be applied
func (*MutexLocalActivityOptions) WithRetryPolicy ¶ added in v1.13.0
func (o *MutexLocalActivityOptions) WithRetryPolicy(policy *temporal.RetryPolicy) *MutexLocalActivityOptions
WithRetryPolicy sets the RetryPolicy value
func (*MutexLocalActivityOptions) WithScheduleToCloseTimeout ¶ added in v1.13.0
func (o *MutexLocalActivityOptions) WithScheduleToCloseTimeout(d time.Duration) *MutexLocalActivityOptions
WithScheduleToCloseTimeout sets the ScheduleToCloseTimeout value
func (*MutexLocalActivityOptions) WithStartToCloseTimeout ¶ added in v1.13.0
func (o *MutexLocalActivityOptions) WithStartToCloseTimeout(d time.Duration) *MutexLocalActivityOptions
WithStartToCloseTimeout sets the StartToCloseTimeout value
type MutexOptions ¶
type MutexOptions struct {
// contains filtered or unexported fields
}
MutexOptions provides configuration for a mutex.v1.Mutex workflow operation
func NewMutexOptions ¶
func NewMutexOptions() *MutexOptions
NewMutexOptions initializes a new MutexOptions value
func (*MutexOptions) Build ¶ added in v1.13.0
func (o *MutexOptions) Build(req protoreflect.Message) (client.StartWorkflowOptions, error)
Build initializes a new go.temporal.io/sdk/client.StartWorkflowOptions value with defaults and overrides applied
func (*MutexOptions) WithExecutionTimeout ¶ added in v1.13.0
func (o *MutexOptions) WithExecutionTimeout(d time.Duration) *MutexOptions
WithExecutionTimeout sets the WorkflowExecutionTimeout value
func (*MutexOptions) WithID ¶ added in v1.13.0
func (o *MutexOptions) WithID(id string) *MutexOptions
WithID sets the ID value
func (*MutexOptions) WithIDReusePolicy ¶ added in v1.13.0
func (o *MutexOptions) WithIDReusePolicy(policy enumsv1.WorkflowIdReusePolicy) *MutexOptions
WithIDReusePolicy sets the WorkflowIDReusePolicy value
func (*MutexOptions) WithRetryPolicy ¶ added in v1.13.0
func (o *MutexOptions) WithRetryPolicy(policy *temporal.RetryPolicy) *MutexOptions
WithRetryPolicy sets the RetryPolicy value
func (*MutexOptions) WithRunTimeout ¶ added in v1.13.0
func (o *MutexOptions) WithRunTimeout(d time.Duration) *MutexOptions
WithRunTimeout sets the WorkflowRunTimeout value
func (*MutexOptions) WithSearchAttributes ¶ added in v1.13.0
func (o *MutexOptions) WithSearchAttributes(sa map[string]any) *MutexOptions
WithSearchAttributes sets the SearchAttributes value
func (*MutexOptions) WithStartWorkflowOptions ¶
func (o *MutexOptions) WithStartWorkflowOptions(options client.StartWorkflowOptions) *MutexOptions
WithStartWorkflowOptions sets the initial go.temporal.io/sdk/client.StartWorkflowOptions
func (*MutexOptions) WithTaskQueue ¶ added in v1.13.0
func (o *MutexOptions) WithTaskQueue(tq string) *MutexOptions
WithTaskQueue sets the TaskQueue value
func (*MutexOptions) WithTaskTimeout ¶ added in v1.13.0
func (o *MutexOptions) WithTaskTimeout(d time.Duration) *MutexOptions
WithTaskTimeout sets the WorkflowTaskTimeout value
func (*MutexOptions) WithWorkflowIdConflictPolicy ¶ added in v1.17.0
func (o *MutexOptions) WithWorkflowIdConflictPolicy(policy enumsv1.WorkflowIdConflictPolicy) *MutexOptions
WithWorkflowIdConflictPolicy sets the WorkflowIdConflictPolicy value
type MutexRun ¶
type MutexRun interface { // ID returns the workflow ID ID() string // RunID returns the workflow instance ID RunID() string // Run returns the inner client.WorkflowRun Run() client.WorkflowRun // Get blocks until the workflow is complete and returns the result Get(ctx context.Context) error // Cancel requests cancellation of a workflow in execution, returning an error if applicable Cancel(ctx context.Context) error // Terminate terminates a workflow in execution, returning an error if applicable Terminate(ctx context.Context, reason string, details ...interface{}) error // ReleaseLock releases a lock on a resource identified by `lease_id`. ReleaseLock(ctx context.Context, req *ReleaseLockInput) error // AcquireLock requests a lock on a resource identified by `resource_id` // and blocks until the lock is acquired, returning a `lease_id` that // can be used to release the lock. AcquireLock(ctx context.Context, req *AcquireLockInput, opts ...*AcquireLockOptions) (*AcquireLockOutput, error) // AcquireLock requests a lock on a resource identified by `resource_id` // and blocks until the lock is acquired, returning a `lease_id` that // can be used to release the lock. AcquireLockAsync(ctx context.Context, req *AcquireLockInput, opts ...*AcquireLockOptions) (AcquireLockHandle, error) }
MutexRun describes a(n) mutex.v1.Mutex workflow run
type MutexWithAcquireLockOptions ¶ added in v1.17.0
type MutexWithAcquireLockOptions struct {
// contains filtered or unexported fields
}
MutexWithAcquireLockOptions is the options for a mutex.v1.Mutex workflow with a mutex.v1.AcquireLock update
func NewMutexWithAcquireLockOptions ¶ added in v1.17.0
func NewMutexWithAcquireLockOptions() *MutexWithAcquireLockOptions
NewMutexWithAcquireLockOptions initializes a new MutexWithAcquireLockOptions value
func (*MutexWithAcquireLockOptions) Build ¶ added in v1.17.0
func (o *MutexWithAcquireLockOptions) Build(ctx context.Context, op func(client.StartWorkflowOptions) client.WithStartWorkflowOperation, input *MutexInput, update *AcquireLockInput) (options client.UpdateWithStartWorkflowOptions, err error)
Build transforms MutexWithAcquireLockOptions into valid client.UpdateWithStartWorkflowOptions
func (*MutexWithAcquireLockOptions) WithAcquireLockOptions ¶ added in v1.17.0
func (o *MutexWithAcquireLockOptions) WithAcquireLockOptions(options *AcquireLockOptions) *MutexWithAcquireLockOptions
WithAcquireLockOptions sets the AcquireLockOptions
func (*MutexWithAcquireLockOptions) WithMutexOptions ¶ added in v1.17.0
func (o *MutexWithAcquireLockOptions) WithMutexOptions(options *MutexOptions) *MutexWithAcquireLockOptions
WithMutexOptions sets the WithMutexOptions
func (*MutexWithAcquireLockOptions) WithUpdateWithStartWorkflowOptions ¶ added in v1.17.0
func (o *MutexWithAcquireLockOptions) WithUpdateWithStartWorkflowOptions(options client.UpdateWithStartWorkflowOptions) *MutexWithAcquireLockOptions
WithUpdateWithStartWorkflowOptions sets the UpdateWithStartWorkflowOptions
type MutexWorkflow ¶
type MutexWorkflow interface { // Execute defines the entrypoint to a(n) mutex.v1.Mutex workflow Execute(ctx workflow.Context) error // AcquireLock requests a lock on a resource identified by `resource_id` // and blocks until the lock is acquired, returning a `lease_id` that // can be used to release the lock. AcquireLock(workflow.Context, *AcquireLockInput) (*AcquireLockOutput, error) }
Mutex is a workflow that manages concurrent access to a resource identified by `resource_id`.
workflow details: (name: "mutex.v1.Mutex", id: "mutex:${! resourceId }")
type MutexWorkflowInput ¶
type MutexWorkflowInput struct { Req *MutexInput ReleaseLock *ReleaseLockSignal }
MutexWorkflowInput describes the input to a(n) mutex.v1.Mutex workflow constructor
type ReleaseLockInput ¶
type ReleaseLockInput struct { LeaseId string `protobuf:"bytes,1,opt,name=lease_id,json=leaseId,proto3" json:"lease_id,omitempty"` // contains filtered or unexported fields }
func UnmarshalCliFlagsToReleaseLockInput ¶
func UnmarshalCliFlagsToReleaseLockInput(cmd *v2.Context, options ...helpers.UnmarshalCliFlagsOptions) (*ReleaseLockInput, error)
UnmarshalCliFlagsToReleaseLockInput unmarshals a ReleaseLockInput from command line flags
func (*ReleaseLockInput) Descriptor
deprecated
func (*ReleaseLockInput) Descriptor() ([]byte, []int)
Deprecated: Use ReleaseLockInput.ProtoReflect.Descriptor instead.
func (*ReleaseLockInput) GetLeaseId ¶
func (x *ReleaseLockInput) GetLeaseId() string
func (*ReleaseLockInput) ProtoMessage ¶
func (*ReleaseLockInput) ProtoMessage()
func (*ReleaseLockInput) ProtoReflect ¶
func (x *ReleaseLockInput) ProtoReflect() protoreflect.Message
func (*ReleaseLockInput) Reset ¶
func (x *ReleaseLockInput) Reset()
func (*ReleaseLockInput) String ¶
func (x *ReleaseLockInput) String() string
type ReleaseLockSignal ¶
type ReleaseLockSignal struct {
Channel workflow.ReceiveChannel
}
ReleaseLockSignal describes a(n) example.mutex.v1.Example.ReleaseLock signal
func NewReleaseLockSignal ¶
func NewReleaseLockSignal(ctx workflow.Context) *ReleaseLockSignal
NewReleaseLockSignal initializes a new mutex.v1.ReleaseLock signal wrapper
func (*ReleaseLockSignal) Receive ¶
func (s *ReleaseLockSignal) Receive(ctx workflow.Context) (*ReleaseLockInput, bool)
Receive blocks until a(n) example.mutex.v1.Example.ReleaseLock signal is received
func (*ReleaseLockSignal) ReceiveAsync ¶
func (s *ReleaseLockSignal) ReceiveAsync() *ReleaseLockInput
ReceiveAsync checks for a example.mutex.v1.Example.ReleaseLock signal without blocking
func (*ReleaseLockSignal) ReceiveWithTimeout ¶
func (s *ReleaseLockSignal) ReceiveWithTimeout(ctx workflow.Context, timeout time.Duration) (resp *ReleaseLockInput, ok bool, more bool)
ReceiveWithTimeout blocks until a(n) example.mutex.v1.Example.ReleaseLock signal is received or timeout expires. Returns more value of false when Channel is closed. Returns ok value of false when no value was found in the channel for the duration of timeout or the ctx was canceled. resp will be nil if ok is false.
func (*ReleaseLockSignal) Select ¶
func (s *ReleaseLockSignal) Select(sel workflow.Selector, fn func(*ReleaseLockInput)) workflow.Selector
Select checks for a(n) example.mutex.v1.Example.ReleaseLock signal without blocking
type SampleWorkflowWithMutexChildOptions ¶
type SampleWorkflowWithMutexChildOptions struct {
// contains filtered or unexported fields
}
SampleWorkflowWithMutexChildOptions provides configuration for a child example.mutex.v1.Example.SampleWorkflowWithMutex workflow operation
func NewSampleWorkflowWithMutexChildOptions ¶
func NewSampleWorkflowWithMutexChildOptions() *SampleWorkflowWithMutexChildOptions
NewSampleWorkflowWithMutexChildOptions initializes a new SampleWorkflowWithMutexChildOptions value
func (*SampleWorkflowWithMutexChildOptions) Build ¶ added in v1.13.0
func (o *SampleWorkflowWithMutexChildOptions) Build(ctx workflow.Context, req protoreflect.Message) (workflow.ChildWorkflowOptions, error)
Build initializes a new go.temporal.io/sdk/workflow.ChildWorkflowOptions value with defaults and overrides applied
func (*SampleWorkflowWithMutexChildOptions) WithChildWorkflowOptions ¶
func (o *SampleWorkflowWithMutexChildOptions) WithChildWorkflowOptions(options workflow.ChildWorkflowOptions) *SampleWorkflowWithMutexChildOptions
WithChildWorkflowOptions sets the initial go.temporal.io/sdk/workflow.ChildWorkflowOptions
func (*SampleWorkflowWithMutexChildOptions) WithDataConverter ¶ added in v1.17.0
func (o *SampleWorkflowWithMutexChildOptions) WithDataConverter(dc converter.DataConverter) *SampleWorkflowWithMutexChildOptions
WithDataConverter registers a DataConverter for the child workflow
func (*SampleWorkflowWithMutexChildOptions) WithExecutionTimeout ¶ added in v1.13.0
func (o *SampleWorkflowWithMutexChildOptions) WithExecutionTimeout(d time.Duration) *SampleWorkflowWithMutexChildOptions
WithExecutionTimeout sets the WorkflowExecutionTimeout value
func (*SampleWorkflowWithMutexChildOptions) WithID ¶ added in v1.13.0
func (o *SampleWorkflowWithMutexChildOptions) WithID(id string) *SampleWorkflowWithMutexChildOptions
WithID sets the WorkflowID value
func (*SampleWorkflowWithMutexChildOptions) WithIDReusePolicy ¶ added in v1.13.0
func (o *SampleWorkflowWithMutexChildOptions) WithIDReusePolicy(policy enumsv1.WorkflowIdReusePolicy) *SampleWorkflowWithMutexChildOptions
WithIDReusePolicy sets the WorkflowIDReusePolicy value
func (*SampleWorkflowWithMutexChildOptions) WithParentClosePolicy ¶ added in v1.13.0
func (o *SampleWorkflowWithMutexChildOptions) WithParentClosePolicy(policy enumsv1.ParentClosePolicy) *SampleWorkflowWithMutexChildOptions
WithParentClosePolicy sets the WorkflowIDReusePolicy value
func (*SampleWorkflowWithMutexChildOptions) WithRetryPolicy ¶ added in v1.13.0
func (o *SampleWorkflowWithMutexChildOptions) WithRetryPolicy(policy *temporal.RetryPolicy) *SampleWorkflowWithMutexChildOptions
WithRetryPolicy sets the RetryPolicy value
func (*SampleWorkflowWithMutexChildOptions) WithRunTimeout ¶ added in v1.13.0
func (o *SampleWorkflowWithMutexChildOptions) WithRunTimeout(d time.Duration) *SampleWorkflowWithMutexChildOptions
WithRunTimeout sets the WorkflowRunTimeout value
func (*SampleWorkflowWithMutexChildOptions) WithSearchAttributes ¶ added in v1.13.0
func (o *SampleWorkflowWithMutexChildOptions) WithSearchAttributes(sa map[string]any) *SampleWorkflowWithMutexChildOptions
WithSearchAttributes sets the SearchAttributes value
func (*SampleWorkflowWithMutexChildOptions) WithTaskQueue ¶ added in v1.13.0
func (o *SampleWorkflowWithMutexChildOptions) WithTaskQueue(tq string) *SampleWorkflowWithMutexChildOptions
WithTaskQueue sets the TaskQueue value
func (*SampleWorkflowWithMutexChildOptions) WithTaskTimeout ¶ added in v1.13.0
func (o *SampleWorkflowWithMutexChildOptions) WithTaskTimeout(d time.Duration) *SampleWorkflowWithMutexChildOptions
WithTaskTimeout sets the WorkflowTaskTimeout value
func (*SampleWorkflowWithMutexChildOptions) WithWaitForCancellation ¶ added in v1.13.0
func (o *SampleWorkflowWithMutexChildOptions) WithWaitForCancellation(wait bool) *SampleWorkflowWithMutexChildOptions
WithWaitForCancellation sets the WaitForCancellation value
func (*SampleWorkflowWithMutexChildOptions) WithWorkflowIdConflictPolicy ¶ added in v1.17.0
func (o *SampleWorkflowWithMutexChildOptions) WithWorkflowIdConflictPolicy(policy enumsv1.WorkflowIdConflictPolicy) *SampleWorkflowWithMutexChildOptions
WithWorkflowIdConflictPolicy sets the WorkflowIdConflictPolicy value
type SampleWorkflowWithMutexChildRun ¶
type SampleWorkflowWithMutexChildRun struct {
Future workflow.ChildWorkflowFuture
}
SampleWorkflowWithMutexChildRun describes a child SampleWorkflowWithMutex workflow run
func SampleWorkflowWithMutexChildAsync ¶
func SampleWorkflowWithMutexChildAsync(ctx workflow.Context, req *SampleWorkflowWithMutexInput, options ...*SampleWorkflowWithMutexChildOptions) (*SampleWorkflowWithMutexChildRun, error)
SampleWorkflowWithMutex is a sample workflow that demonstrates how to use the Mutex service.
func (*SampleWorkflowWithMutexChildRun) Get ¶
func (r *SampleWorkflowWithMutexChildRun) Get(ctx workflow.Context) error
Get blocks until the workflow is completed, returning the response value
func (*SampleWorkflowWithMutexChildRun) Select ¶
func (r *SampleWorkflowWithMutexChildRun) Select(sel workflow.Selector, fn func(*SampleWorkflowWithMutexChildRun)) workflow.Selector
Select adds this completion to the selector. Callback can be nil.
func (*SampleWorkflowWithMutexChildRun) SelectStart ¶
func (r *SampleWorkflowWithMutexChildRun) SelectStart(sel workflow.Selector, fn func(*SampleWorkflowWithMutexChildRun)) workflow.Selector
SelectStart adds waiting for start to the selector. Callback can be nil.
type SampleWorkflowWithMutexInput ¶
type SampleWorkflowWithMutexInput struct { ResourceId string `protobuf:"bytes,1,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` Sleep *durationpb.Duration `protobuf:"bytes,2,opt,name=sleep,proto3" json:"sleep,omitempty"` // contains filtered or unexported fields }
func UnmarshalCliFlagsToSampleWorkflowWithMutexInput ¶
func UnmarshalCliFlagsToSampleWorkflowWithMutexInput(cmd *v2.Context, options ...helpers.UnmarshalCliFlagsOptions) (*SampleWorkflowWithMutexInput, error)
UnmarshalCliFlagsToSampleWorkflowWithMutexInput unmarshals a SampleWorkflowWithMutexInput from command line flags
func (*SampleWorkflowWithMutexInput) Descriptor
deprecated
func (*SampleWorkflowWithMutexInput) Descriptor() ([]byte, []int)
Deprecated: Use SampleWorkflowWithMutexInput.ProtoReflect.Descriptor instead.
func (*SampleWorkflowWithMutexInput) GetResourceId ¶
func (x *SampleWorkflowWithMutexInput) GetResourceId() string
func (*SampleWorkflowWithMutexInput) GetSleep ¶
func (x *SampleWorkflowWithMutexInput) GetSleep() *durationpb.Duration
func (*SampleWorkflowWithMutexInput) ProtoMessage ¶
func (*SampleWorkflowWithMutexInput) ProtoMessage()
func (*SampleWorkflowWithMutexInput) ProtoReflect ¶
func (x *SampleWorkflowWithMutexInput) ProtoReflect() protoreflect.Message
func (*SampleWorkflowWithMutexInput) Reset ¶
func (x *SampleWorkflowWithMutexInput) Reset()
func (*SampleWorkflowWithMutexInput) String ¶
func (x *SampleWorkflowWithMutexInput) String() string
type SampleWorkflowWithMutexOptions ¶
type SampleWorkflowWithMutexOptions struct {
// contains filtered or unexported fields
}
SampleWorkflowWithMutexOptions provides configuration for a example.mutex.v1.Example.SampleWorkflowWithMutex workflow operation
func NewSampleWorkflowWithMutexOptions ¶
func NewSampleWorkflowWithMutexOptions() *SampleWorkflowWithMutexOptions
NewSampleWorkflowWithMutexOptions initializes a new SampleWorkflowWithMutexOptions value
func (*SampleWorkflowWithMutexOptions) Build ¶ added in v1.13.0
func (o *SampleWorkflowWithMutexOptions) Build(req protoreflect.Message) (client.StartWorkflowOptions, error)
Build initializes a new go.temporal.io/sdk/client.StartWorkflowOptions value with defaults and overrides applied
func (*SampleWorkflowWithMutexOptions) WithExecutionTimeout ¶ added in v1.13.0
func (o *SampleWorkflowWithMutexOptions) WithExecutionTimeout(d time.Duration) *SampleWorkflowWithMutexOptions
WithExecutionTimeout sets the WorkflowExecutionTimeout value
func (*SampleWorkflowWithMutexOptions) WithID ¶ added in v1.13.0
func (o *SampleWorkflowWithMutexOptions) WithID(id string) *SampleWorkflowWithMutexOptions
WithID sets the ID value
func (*SampleWorkflowWithMutexOptions) WithIDReusePolicy ¶ added in v1.13.0
func (o *SampleWorkflowWithMutexOptions) WithIDReusePolicy(policy enumsv1.WorkflowIdReusePolicy) *SampleWorkflowWithMutexOptions
WithIDReusePolicy sets the WorkflowIDReusePolicy value
func (*SampleWorkflowWithMutexOptions) WithRetryPolicy ¶ added in v1.13.0
func (o *SampleWorkflowWithMutexOptions) WithRetryPolicy(policy *temporal.RetryPolicy) *SampleWorkflowWithMutexOptions
WithRetryPolicy sets the RetryPolicy value
func (*SampleWorkflowWithMutexOptions) WithRunTimeout ¶ added in v1.13.0
func (o *SampleWorkflowWithMutexOptions) WithRunTimeout(d time.Duration) *SampleWorkflowWithMutexOptions
WithRunTimeout sets the WorkflowRunTimeout value
func (*SampleWorkflowWithMutexOptions) WithSearchAttributes ¶ added in v1.13.0
func (o *SampleWorkflowWithMutexOptions) WithSearchAttributes(sa map[string]any) *SampleWorkflowWithMutexOptions
WithSearchAttributes sets the SearchAttributes value
func (*SampleWorkflowWithMutexOptions) WithStartWorkflowOptions ¶
func (o *SampleWorkflowWithMutexOptions) WithStartWorkflowOptions(options client.StartWorkflowOptions) *SampleWorkflowWithMutexOptions
WithStartWorkflowOptions sets the initial go.temporal.io/sdk/client.StartWorkflowOptions
func (*SampleWorkflowWithMutexOptions) WithTaskQueue ¶ added in v1.13.0
func (o *SampleWorkflowWithMutexOptions) WithTaskQueue(tq string) *SampleWorkflowWithMutexOptions
WithTaskQueue sets the TaskQueue value
func (*SampleWorkflowWithMutexOptions) WithTaskTimeout ¶ added in v1.13.0
func (o *SampleWorkflowWithMutexOptions) WithTaskTimeout(d time.Duration) *SampleWorkflowWithMutexOptions
WithTaskTimeout sets the WorkflowTaskTimeout value
func (*SampleWorkflowWithMutexOptions) WithWorkflowIdConflictPolicy ¶ added in v1.17.0
func (o *SampleWorkflowWithMutexOptions) WithWorkflowIdConflictPolicy(policy enumsv1.WorkflowIdConflictPolicy) *SampleWorkflowWithMutexOptions
WithWorkflowIdConflictPolicy sets the WorkflowIdConflictPolicy value
type SampleWorkflowWithMutexRun ¶
type SampleWorkflowWithMutexRun interface { // ID returns the workflow ID ID() string // RunID returns the workflow instance ID RunID() string // Run returns the inner client.WorkflowRun Run() client.WorkflowRun // Get blocks until the workflow is complete and returns the result Get(ctx context.Context) error // Cancel requests cancellation of a workflow in execution, returning an error if applicable Cancel(ctx context.Context) error // Terminate terminates a workflow in execution, returning an error if applicable Terminate(ctx context.Context, reason string, details ...interface{}) error }
SampleWorkflowWithMutexRun describes a(n) example.mutex.v1.Example.SampleWorkflowWithMutex workflow run
type SampleWorkflowWithMutexWorkflow ¶
type SampleWorkflowWithMutexWorkflow interface { // Execute defines the entrypoint to a(n) example.mutex.v1.Example.SampleWorkflowWithMutex workflow Execute(ctx workflow.Context) error }
SampleWorkflowWithMutex is a sample workflow that demonstrates how to use the Mutex service.
workflow details: (name: "example.mutex.v1.Example.SampleWorkflowWithMutex", id: "SampleWorkflow1WithMutex_${! uuid_v4() }")
type SampleWorkflowWithMutexWorkflowInput ¶
type SampleWorkflowWithMutexWorkflowInput struct {
Req *SampleWorkflowWithMutexInput
}
SampleWorkflowWithMutexWorkflowInput describes the input to a(n) example.mutex.v1.Example.SampleWorkflowWithMutex workflow constructor
type TestExampleClient ¶
type TestExampleClient struct {
// contains filtered or unexported fields
}
TestClient provides a testsuite-compatible Client
func NewTestExampleClient ¶
func NewTestExampleClient(env *testsuite.TestWorkflowEnvironment, workflows ExampleWorkflows, activities ExampleActivities) *TestExampleClient
NewTestExampleClient initializes a new TestExampleClient value
func (*TestExampleClient) AcquireLock ¶
func (c *TestExampleClient) AcquireLock(ctx context.Context, workflowID string, runID string, req *AcquireLockInput, opts ...*AcquireLockOptions) (*AcquireLockOutput, error)
AcquireLock executes a(n) mutex.v1.AcquireLock update in the test environment
func (*TestExampleClient) AcquireLockAsync ¶ added in v1.17.0
func (c *TestExampleClient) AcquireLockAsync(ctx context.Context, workflowID string, runID string, req *AcquireLockInput, opts ...*AcquireLockOptions) (AcquireLockHandle, error)
AcquireLockAsync executes a(n) mutex.v1.AcquireLock update in the test environment
func (*TestExampleClient) CancelWorkflow ¶
func (c *TestExampleClient) CancelWorkflow(ctx context.Context, workflowID string, runID string) error
CancelWorkflow requests cancellation of an existing workflow execution
func (*TestExampleClient) GetAcquireLock ¶ added in v1.17.0
func (c *TestExampleClient) GetAcquireLock(ctx context.Context, req client.GetWorkflowUpdateHandleOptions) (AcquireLockHandle, error)
GetAcquireLock retrieves a handle to an existing mutex.v1.AcquireLock update
func (*TestExampleClient) GetSampleWorkflowWithMutex ¶
func (c *TestExampleClient) GetSampleWorkflowWithMutex(ctx context.Context, workflowID string, runID string) SampleWorkflowWithMutexRun
GetSampleWorkflowWithMutex is a noop
func (*TestExampleClient) Mutex ¶
func (c *TestExampleClient) Mutex(ctx context.Context, req *MutexInput, opts ...*MutexOptions) error
Mutex executes a(n) mutex.v1.Mutex workflow in the test environment
func (*TestExampleClient) MutexAsync ¶
func (c *TestExampleClient) MutexAsync(ctx context.Context, req *MutexInput, options ...*MutexOptions) (MutexRun, error)
MutexAsync executes a(n) mutex.v1.Mutex workflow in the test environment
func (*TestExampleClient) MutexWithAcquireLock ¶
func (c *TestExampleClient) MutexWithAcquireLock(ctx context.Context, input *MutexInput, update *AcquireLockInput, options ...*MutexWithAcquireLockOptions) (*AcquireLockOutput, MutexRun, error)
MutexWithAcquireLock executes a(n) mutex.v1.Mutex workflow and a(n) mutex.v1.AcquireLock update in the test environment
func (*TestExampleClient) MutexWithAcquireLockAsync ¶
func (c *TestExampleClient) MutexWithAcquireLockAsync(ctx context.Context, input *MutexInput, update *AcquireLockInput, options ...*MutexWithAcquireLockOptions) (AcquireLockHandle, MutexRun, error)
MutexWithAcquireLockAsync executes a(n) mutex.v1.Mutex workflow and a(n) mutex.v1.AcquireLock update in the test environment
func (*TestExampleClient) ReleaseLock ¶
func (c *TestExampleClient) ReleaseLock(ctx context.Context, workflowID string, runID string, req *ReleaseLockInput) error
ReleaseLock executes a mutex.v1.ReleaseLock signal
func (*TestExampleClient) SampleWorkflowWithMutex ¶
func (c *TestExampleClient) SampleWorkflowWithMutex(ctx context.Context, req *SampleWorkflowWithMutexInput, opts ...*SampleWorkflowWithMutexOptions) error
SampleWorkflowWithMutex executes a(n) example.mutex.v1.Example.SampleWorkflowWithMutex workflow in the test environment
func (*TestExampleClient) SampleWorkflowWithMutexAsync ¶
func (c *TestExampleClient) SampleWorkflowWithMutexAsync(ctx context.Context, req *SampleWorkflowWithMutexInput, options ...*SampleWorkflowWithMutexOptions) (SampleWorkflowWithMutexRun, error)
SampleWorkflowWithMutexAsync executes a(n) example.mutex.v1.Example.SampleWorkflowWithMutex workflow in the test environment
func (*TestExampleClient) TerminateWorkflow ¶
func (c *TestExampleClient) TerminateWorkflow(ctx context.Context, workflowID string, runID string, reason string, details ...interface{}) error
TerminateWorkflow terminates an existing workflow execution
Directories
¶
Path | Synopsis |
---|---|
Code generated by protoc-gen-go_temporal.
|
Code generated by protoc-gen-go_temporal. |