Documentation
¶
Overview ¶
Code generated by protoc-gen-go_temporal. DO NOT EDIT. versions:
protoc-gen-go_temporal 0.7.3-next (4c80354746dfa46c6614ed9a753c66631cb02a2d) go go1.19.5 protoc (unknown)
source: example.proto
Index ¶
- Constants
- Variables
- func AcquireLeaseExternal(ctx workflow.Context, workflowID string, runID string, ...) workflow.Future
- func LeaseAcquiredExternal(ctx workflow.Context, workflowID string, runID string, ...) workflow.Future
- func RegisterActivities(r worker.Registry, activities Activities)
- func RegisterMutexActivity(r worker.Registry, fn func(context.Context, *MutexRequest) error)
- func RegisterMutexWorkflow(r worker.Registry, ...)
- func RegisterSampleWorkflowWithMutexWorkflow(r worker.Registry, ...)
- func RegisterWorkflows(r worker.Registry, workflows Workflows)
- func RenewLeaseExternal(ctx workflow.Context, workflowID string, runID string, req *RenewLeaseRequest) workflow.Future
- func RevokeLeaseExternal(ctx workflow.Context, workflowID string, runID string, req *RevokeLeaseRequest) workflow.Future
- type AcquireLeaseRequest
- func (*AcquireLeaseRequest) Descriptor() ([]byte, []int)deprecated
- func (x *AcquireLeaseRequest) GetTimeout() *durationpb.Duration
- func (x *AcquireLeaseRequest) GetWorkflowId() string
- func (*AcquireLeaseRequest) ProtoMessage()
- func (x *AcquireLeaseRequest) ProtoReflect() protoreflect.Message
- func (x *AcquireLeaseRequest) Reset()
- func (x *AcquireLeaseRequest) String() string
- type AcquireLeaseSignal
- type Activities
- type Client
- type LeaseAcquiredRequest
- func (*LeaseAcquiredRequest) Descriptor() ([]byte, []int)deprecated
- func (x *LeaseAcquiredRequest) GetLeaseId() string
- func (x *LeaseAcquiredRequest) GetRunId() string
- func (x *LeaseAcquiredRequest) GetWorkflowId() string
- func (*LeaseAcquiredRequest) ProtoMessage()
- func (x *LeaseAcquiredRequest) ProtoReflect() protoreflect.Message
- func (x *LeaseAcquiredRequest) Reset()
- func (x *LeaseAcquiredRequest) String() string
- type LeaseAcquiredSignal
- type MutexChildRun
- func (r *MutexChildRun) AcquireLease(ctx workflow.Context, input *AcquireLeaseRequest) workflow.Future
- func (r *MutexChildRun) Get(ctx workflow.Context) error
- func (r *MutexChildRun) RenewLease(ctx workflow.Context, input *RenewLeaseRequest) workflow.Future
- func (r *MutexChildRun) RevokeLease(ctx workflow.Context, input *RevokeLeaseRequest) 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 MutexRequest
- type MutexRun
- type MutexWorkflow
- type RenewLeaseRequest
- func (*RenewLeaseRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RenewLeaseRequest) GetLeaseId() string
- func (x *RenewLeaseRequest) GetTimeout() *durationpb.Duration
- func (*RenewLeaseRequest) ProtoMessage()
- func (x *RenewLeaseRequest) ProtoReflect() protoreflect.Message
- func (x *RenewLeaseRequest) Reset()
- func (x *RenewLeaseRequest) String() string
- type RenewLeaseSignal
- type RevokeLeaseRequest
- func (*RevokeLeaseRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RevokeLeaseRequest) GetLeaseId() string
- func (*RevokeLeaseRequest) ProtoMessage()
- func (x *RevokeLeaseRequest) ProtoReflect() protoreflect.Message
- func (x *RevokeLeaseRequest) Reset()
- func (x *RevokeLeaseRequest) String() string
- type RevokeLeaseSignal
- type SampleWorkflowWithMutexChildRun
- func (r *SampleWorkflowWithMutexChildRun) Get(ctx workflow.Context) (*SampleWorkflowWithMutexResponse, error)
- func (r *SampleWorkflowWithMutexChildRun) LeaseAcquired(ctx workflow.Context, input *LeaseAcquiredRequest) workflow.Future
- 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
- type SampleWorkflowWithMutexRequest
- func (*SampleWorkflowWithMutexRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SampleWorkflowWithMutexRequest) GetAmount() float64
- func (x *SampleWorkflowWithMutexRequest) GetDest() string
- func (x *SampleWorkflowWithMutexRequest) GetResource() string
- func (*SampleWorkflowWithMutexRequest) ProtoMessage()
- func (x *SampleWorkflowWithMutexRequest) ProtoReflect() protoreflect.Message
- func (x *SampleWorkflowWithMutexRequest) Reset()
- func (x *SampleWorkflowWithMutexRequest) String() string
- type SampleWorkflowWithMutexResponse
- func (*SampleWorkflowWithMutexResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SampleWorkflowWithMutexResponse) GetResult() string
- func (*SampleWorkflowWithMutexResponse) ProtoMessage()
- func (x *SampleWorkflowWithMutexResponse) ProtoReflect() protoreflect.Message
- func (x *SampleWorkflowWithMutexResponse) Reset()
- func (x *SampleWorkflowWithMutexResponse) String() string
- type SampleWorkflowWithMutexRun
- type SampleWorkflowWithMutexWorkflow
- type Workflows
Constants ¶
const ( MutexWorkflowName = "mycompany.mutex.v1.Mutex.MutexWorkflow" SampleWorkflowWithMutexWorkflowName = "mycompany.mutex.v1.Mutex.SampleWorkflowWithMutexWorkflow" )
Mutex workflow names
const ( AcquireLeaseSignalName = "mycompany.mutex.v1.Mutex.AcquireLeaseSignal" LeaseAcquiredSignalName = "mycompany.mutex.v1.Mutex.LeaseAcquiredSignal" RenewLeaseSignalName = "mycompany.mutex.v1.Mutex.RenewLeaseSignal" RevokeLeaseSignalName = "mycompany.mutex.v1.Mutex.RevokeLeaseSignal" )
Mutex signal names
const (
MutexActivityName = "mycompany.mutex.v1.Mutex.MutexActivity"
)
Mutex activity names
const MutexTaskQueue = "mutex-v1"
MutexTaskQueue is the default task-queue for a Mutex worker
Variables ¶
var ( MutexIDExpression = expression.MustParseExpression("mutex/${!resource}") SampleWorkflowWithMutexIDExpression = expression.MustParseExpression("sample-workflow-with-mutex/${!resource}/${!uuid_v4()}") )
Mutex id expressions
var File_example_proto protoreflect.FileDescriptor
Functions ¶
func AcquireLeaseExternal ¶
func AcquireLeaseExternal(ctx workflow.Context, workflowID string, runID string, req *AcquireLeaseRequest) workflow.Future
AcquireLeaseExternal sends a AcquireLease signal to an existing workflow
func LeaseAcquiredExternal ¶
func LeaseAcquiredExternal(ctx workflow.Context, workflowID string, runID string, req *LeaseAcquiredRequest) workflow.Future
LeaseAcquiredExternal sends a LeaseAcquired signal to an existing workflow
func RegisterActivities ¶
func RegisterActivities(r worker.Registry, activities Activities)
RegisterActivities registers activities with a worker
func RegisterMutexActivity ¶
RegisterMutexActivity registers a Mutex activity
func RegisterMutexWorkflow ¶
func RegisterMutexWorkflow(r worker.Registry, wf func(workflow.Context, *MutexInput) (MutexWorkflow, error))
RegisterMutexWorkflow registers a Mutex workflow with the given worker
func RegisterSampleWorkflowWithMutexWorkflow ¶
func RegisterSampleWorkflowWithMutexWorkflow(r worker.Registry, wf func(workflow.Context, *SampleWorkflowWithMutexInput) (SampleWorkflowWithMutexWorkflow, error))
RegisterSampleWorkflowWithMutexWorkflow registers a SampleWorkflowWithMutex workflow with the given worker
func RegisterWorkflows ¶
RegisterWorkflows registers Mutex workflows with the given worker
func RenewLeaseExternal ¶
func RenewLeaseExternal(ctx workflow.Context, workflowID string, runID string, req *RenewLeaseRequest) workflow.Future
RenewLeaseExternal sends a RenewLease signal to an existing workflow
func RevokeLeaseExternal ¶
func RevokeLeaseExternal(ctx workflow.Context, workflowID string, runID string, req *RevokeLeaseRequest) workflow.Future
RevokeLeaseExternal sends a RevokeLease signal to an existing workflow
Types ¶
type AcquireLeaseRequest ¶ added in v0.7.1
type AcquireLeaseRequest struct {
WorkflowId string `protobuf:"bytes,1,opt,name=workflow_id,json=workflowId,proto3" json:"workflow_id,omitempty"`
Timeout *durationpb.Duration `protobuf:"bytes,2,opt,name=timeout,proto3" json:"timeout,omitempty"`
// contains filtered or unexported fields
}
AcquireLeaseRequest describes the input to a AcquireLease signal
func (*AcquireLeaseRequest) Descriptor
deprecated
added in
v0.7.1
func (*AcquireLeaseRequest) Descriptor() ([]byte, []int)
Deprecated: Use AcquireLeaseRequest.ProtoReflect.Descriptor instead.
func (*AcquireLeaseRequest) GetTimeout ¶ added in v0.7.1
func (x *AcquireLeaseRequest) GetTimeout() *durationpb.Duration
func (*AcquireLeaseRequest) GetWorkflowId ¶ added in v0.7.1
func (x *AcquireLeaseRequest) GetWorkflowId() string
func (*AcquireLeaseRequest) ProtoMessage ¶ added in v0.7.1
func (*AcquireLeaseRequest) ProtoMessage()
func (*AcquireLeaseRequest) ProtoReflect ¶ added in v0.7.1
func (x *AcquireLeaseRequest) ProtoReflect() protoreflect.Message
func (*AcquireLeaseRequest) Reset ¶ added in v0.7.1
func (x *AcquireLeaseRequest) Reset()
func (*AcquireLeaseRequest) String ¶ added in v0.7.1
func (x *AcquireLeaseRequest) String() string
type AcquireLeaseSignal ¶
type AcquireLeaseSignal struct {
Channel workflow.ReceiveChannel
}
AcquireLeaseSignal describes a AcquireLease signal
func (*AcquireLeaseSignal) Receive ¶ added in v0.7.1
func (s *AcquireLeaseSignal) Receive(ctx workflow.Context) (*AcquireLeaseRequest, bool)
Receive blocks until a AcquireLease signal is received
func (*AcquireLeaseSignal) ReceiveAsync ¶ added in v0.7.1
func (s *AcquireLeaseSignal) ReceiveAsync() *AcquireLeaseRequest
ReceiveAsync checks for a AcquireLease signal without blocking
func (*AcquireLeaseSignal) Select ¶ added in v0.7.1
func (s *AcquireLeaseSignal) Select(sel workflow.Selector, fn func(*AcquireLeaseRequest)) workflow.Selector
Select checks for a AcquireLease signal without blocking
type Activities ¶
type Activities interface {
// Mutex provides a mutex over a shared resource
Mutex(ctx context.Context, req *MutexRequest) error
}
Activities describes available worker activites
type Client ¶
type Client interface {
// Mutex provides a mutex over a shared resource
Mutex(ctx context.Context, opts *client.StartWorkflowOptions, req *MutexRequest) error
// ExecuteMutex executes a Mutex workflow
ExecuteMutex(ctx context.Context, opts *client.StartWorkflowOptions, req *MutexRequest) (MutexRun, error)
// GetMutex retrieves a Mutex workflow execution
GetMutex(ctx context.Context, workflowID string, runID string) (MutexRun, error)
// StartMutexWithAcquireLease sends a AcquireLease signal to a Mutex workflow, starting it if not present
StartMutexWithAcquireLease(ctx context.Context, opts *client.StartWorkflowOptions, req *MutexRequest, signal *AcquireLeaseRequest) (MutexRun, error)
// SampleWorkflowWithMutex provides an example of a running workflow that uses
// a Mutex workflow to prevent concurrent access to a shared resource
SampleWorkflowWithMutex(ctx context.Context, opts *client.StartWorkflowOptions, req *SampleWorkflowWithMutexRequest) (*SampleWorkflowWithMutexResponse, error)
// ExecuteSampleWorkflowWithMutex executes a SampleWorkflowWithMutex workflow
ExecuteSampleWorkflowWithMutex(ctx context.Context, opts *client.StartWorkflowOptions, req *SampleWorkflowWithMutexRequest) (SampleWorkflowWithMutexRun, error)
// GetSampleWorkflowWithMutex retrieves a SampleWorkflowWithMutex workflow execution
GetSampleWorkflowWithMutex(ctx context.Context, workflowID string, runID string) (SampleWorkflowWithMutexRun, error)
// SignalAcquireLease sends a AcquireLease signal to an existing workflow
SignalAcquireLease(ctx context.Context, workflowID string, runID string, signal *AcquireLeaseRequest) error
// SignalLeaseAcquired sends a LeaseAcquired signal to an existing workflow
SignalLeaseAcquired(ctx context.Context, workflowID string, runID string, signal *LeaseAcquiredRequest) error
// SignalRenewLease sends a RenewLease signal to an existing workflow
SignalRenewLease(ctx context.Context, workflowID string, runID string, signal *RenewLeaseRequest) error
// SignalRevokeLease sends a RevokeLease signal to an existing workflow
SignalRevokeLease(ctx context.Context, workflowID string, runID string, signal *RevokeLeaseRequest) error
}
Client describes a client for a Mutex worker
type LeaseAcquiredRequest ¶ added in v0.7.1
type LeaseAcquiredRequest struct {
WorkflowId string `protobuf:"bytes,1,opt,name=workflow_id,json=workflowId,proto3" json:"workflow_id,omitempty"`
RunId string `protobuf:"bytes,2,opt,name=run_id,json=runId,proto3" json:"run_id,omitempty"`
LeaseId string `protobuf:"bytes,3,opt,name=lease_id,json=leaseId,proto3" json:"lease_id,omitempty"`
// contains filtered or unexported fields
}
LeaseAcquiredRequest describes the input to a LeaseAcquired signal
func (*LeaseAcquiredRequest) Descriptor
deprecated
added in
v0.7.1
func (*LeaseAcquiredRequest) Descriptor() ([]byte, []int)
Deprecated: Use LeaseAcquiredRequest.ProtoReflect.Descriptor instead.
func (*LeaseAcquiredRequest) GetLeaseId ¶ added in v0.7.1
func (x *LeaseAcquiredRequest) GetLeaseId() string
func (*LeaseAcquiredRequest) GetRunId ¶ added in v0.7.1
func (x *LeaseAcquiredRequest) GetRunId() string
func (*LeaseAcquiredRequest) GetWorkflowId ¶ added in v0.7.1
func (x *LeaseAcquiredRequest) GetWorkflowId() string
func (*LeaseAcquiredRequest) ProtoMessage ¶ added in v0.7.1
func (*LeaseAcquiredRequest) ProtoMessage()
func (*LeaseAcquiredRequest) ProtoReflect ¶ added in v0.7.1
func (x *LeaseAcquiredRequest) ProtoReflect() protoreflect.Message
func (*LeaseAcquiredRequest) Reset ¶ added in v0.7.1
func (x *LeaseAcquiredRequest) Reset()
func (*LeaseAcquiredRequest) String ¶ added in v0.7.1
func (x *LeaseAcquiredRequest) String() string
type LeaseAcquiredSignal ¶
type LeaseAcquiredSignal struct {
Channel workflow.ReceiveChannel
}
LeaseAcquiredSignal describes a LeaseAcquired signal
func (*LeaseAcquiredSignal) Receive ¶ added in v0.7.1
func (s *LeaseAcquiredSignal) Receive(ctx workflow.Context) (*LeaseAcquiredRequest, bool)
Receive blocks until a LeaseAcquired signal is received
func (*LeaseAcquiredSignal) ReceiveAsync ¶ added in v0.7.1
func (s *LeaseAcquiredSignal) ReceiveAsync() *LeaseAcquiredRequest
ReceiveAsync checks for a LeaseAcquired signal without blocking
func (*LeaseAcquiredSignal) Select ¶ added in v0.7.1
func (s *LeaseAcquiredSignal) Select(sel workflow.Selector, fn func(*LeaseAcquiredRequest)) workflow.Selector
Select checks for a LeaseAcquired signal without blocking
type MutexChildRun ¶
type MutexChildRun struct {
Future workflow.ChildWorkflowFuture
}
MutexChildRun describes a child Mutex workflow run
func MutexChild ¶
func MutexChild(ctx workflow.Context, opts *workflow.ChildWorkflowOptions, req *MutexRequest) *MutexChildRun
MutexChild executes a child Mutex workflow
func (*MutexChildRun) AcquireLease ¶
func (r *MutexChildRun) AcquireLease(ctx workflow.Context, input *AcquireLeaseRequest) workflow.Future
AcquireLease sends the corresponding signal request to the child workflow
func (*MutexChildRun) Get ¶
func (r *MutexChildRun) Get(ctx workflow.Context) error
Get blocks until the workflow is completed, returning the response value
func (*MutexChildRun) RenewLease ¶
func (r *MutexChildRun) RenewLease(ctx workflow.Context, input *RenewLeaseRequest) workflow.Future
RenewLease sends the corresponding signal request to the child workflow
func (*MutexChildRun) RevokeLease ¶
func (r *MutexChildRun) RevokeLease(ctx workflow.Context, input *RevokeLeaseRequest) workflow.Future
RevokeLease sends the corresponding 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 Mutex activity execution
func Mutex ¶
func Mutex(ctx workflow.Context, opts *workflow.ActivityOptions, req *MutexRequest) *MutexFuture
Mutex provides a mutex over a shared resource
func MutexLocal ¶
func MutexLocal(ctx workflow.Context, opts *workflow.LocalActivityOptions, fn func(context.Context, *MutexRequest) error, req *MutexRequest) *MutexFuture
Mutex provides a mutex over a shared resource
func (*MutexFuture) Get ¶
func (f *MutexFuture) Get(ctx workflow.Context) error
Get blocks on a Mutex execution, returning the response
func (*MutexFuture) Select ¶
func (f *MutexFuture) Select(sel workflow.Selector, fn func(*MutexFuture)) workflow.Selector
Select adds the Mutex completion to the selector, callback can be nil
type MutexInput ¶
type MutexInput struct {
Req *MutexRequest
AcquireLease *AcquireLeaseSignal
RenewLease *RenewLeaseSignal
RevokeLease *RevokeLeaseSignal
}
MutexInput describes the input to a Mutex workflow constructor
type MutexRequest ¶
type MutexRequest struct {
Resource string `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"`
// contains filtered or unexported fields
}
MutexRequest describes the input to a Mutex workflow/activity
func (*MutexRequest) Descriptor
deprecated
func (*MutexRequest) Descriptor() ([]byte, []int)
Deprecated: Use MutexRequest.ProtoReflect.Descriptor instead.
func (*MutexRequest) GetResource ¶
func (x *MutexRequest) GetResource() string
func (*MutexRequest) ProtoMessage ¶
func (*MutexRequest) ProtoMessage()
func (*MutexRequest) ProtoReflect ¶
func (x *MutexRequest) ProtoReflect() protoreflect.Message
func (*MutexRequest) Reset ¶
func (x *MutexRequest) Reset()
func (*MutexRequest) String ¶
func (x *MutexRequest) String() string
type MutexRun ¶
type MutexRun interface {
// ID returns the workflow ID
ID() string
// RunID returns the workflow instance ID
RunID() string
// Get blocks until the workflow is complete and returns the result
Get(ctx context.Context) error
// AcquireLease sends a AcquireLease signal to the workflow
AcquireLease(ctx context.Context, req *AcquireLeaseRequest) error
// RenewLease sends a RenewLease signal to the workflow
RenewLease(ctx context.Context, req *RenewLeaseRequest) error
// RevokeLease sends a RevokeLease signal to the workflow
RevokeLease(ctx context.Context, req *RevokeLeaseRequest) error
}
MutexRun describes a Mutex workflow run
type MutexWorkflow ¶
Mutex provides a mutex over a shared resource
type RenewLeaseRequest ¶ added in v0.7.1
type RenewLeaseRequest struct {
LeaseId string `protobuf:"bytes,1,opt,name=lease_id,json=leaseId,proto3" json:"lease_id,omitempty"`
Timeout *durationpb.Duration `protobuf:"bytes,2,opt,name=timeout,proto3" json:"timeout,omitempty"`
// contains filtered or unexported fields
}
RenewLeaseRequest describes the input to a RenewLease signal
func (*RenewLeaseRequest) Descriptor
deprecated
added in
v0.7.1
func (*RenewLeaseRequest) Descriptor() ([]byte, []int)
Deprecated: Use RenewLeaseRequest.ProtoReflect.Descriptor instead.
func (*RenewLeaseRequest) GetLeaseId ¶ added in v0.7.1
func (x *RenewLeaseRequest) GetLeaseId() string
func (*RenewLeaseRequest) GetTimeout ¶ added in v0.7.1
func (x *RenewLeaseRequest) GetTimeout() *durationpb.Duration
func (*RenewLeaseRequest) ProtoMessage ¶ added in v0.7.1
func (*RenewLeaseRequest) ProtoMessage()
func (*RenewLeaseRequest) ProtoReflect ¶ added in v0.7.1
func (x *RenewLeaseRequest) ProtoReflect() protoreflect.Message
func (*RenewLeaseRequest) Reset ¶ added in v0.7.1
func (x *RenewLeaseRequest) Reset()
func (*RenewLeaseRequest) String ¶ added in v0.7.1
func (x *RenewLeaseRequest) String() string
type RenewLeaseSignal ¶
type RenewLeaseSignal struct {
Channel workflow.ReceiveChannel
}
RenewLeaseSignal describes a RenewLease signal
func (*RenewLeaseSignal) Receive ¶ added in v0.7.1
func (s *RenewLeaseSignal) Receive(ctx workflow.Context) (*RenewLeaseRequest, bool)
Receive blocks until a RenewLease signal is received
func (*RenewLeaseSignal) ReceiveAsync ¶ added in v0.7.1
func (s *RenewLeaseSignal) ReceiveAsync() *RenewLeaseRequest
ReceiveAsync checks for a RenewLease signal without blocking
func (*RenewLeaseSignal) Select ¶ added in v0.7.1
func (s *RenewLeaseSignal) Select(sel workflow.Selector, fn func(*RenewLeaseRequest)) workflow.Selector
Select checks for a RenewLease signal without blocking
type RevokeLeaseRequest ¶ added in v0.7.1
type RevokeLeaseRequest struct {
LeaseId string `protobuf:"bytes,1,opt,name=lease_id,json=leaseId,proto3" json:"lease_id,omitempty"`
// contains filtered or unexported fields
}
RevokeLeaseRequest describes the input to a RevokeLease signal
func (*RevokeLeaseRequest) Descriptor
deprecated
added in
v0.7.1
func (*RevokeLeaseRequest) Descriptor() ([]byte, []int)
Deprecated: Use RevokeLeaseRequest.ProtoReflect.Descriptor instead.
func (*RevokeLeaseRequest) GetLeaseId ¶ added in v0.7.1
func (x *RevokeLeaseRequest) GetLeaseId() string
func (*RevokeLeaseRequest) ProtoMessage ¶ added in v0.7.1
func (*RevokeLeaseRequest) ProtoMessage()
func (*RevokeLeaseRequest) ProtoReflect ¶ added in v0.7.1
func (x *RevokeLeaseRequest) ProtoReflect() protoreflect.Message
func (*RevokeLeaseRequest) Reset ¶ added in v0.7.1
func (x *RevokeLeaseRequest) Reset()
func (*RevokeLeaseRequest) String ¶ added in v0.7.1
func (x *RevokeLeaseRequest) String() string
type RevokeLeaseSignal ¶
type RevokeLeaseSignal struct {
Channel workflow.ReceiveChannel
}
RevokeLeaseSignal describes a RevokeLease signal
func (*RevokeLeaseSignal) Receive ¶ added in v0.7.1
func (s *RevokeLeaseSignal) Receive(ctx workflow.Context) (*RevokeLeaseRequest, bool)
Receive blocks until a RevokeLease signal is received
func (*RevokeLeaseSignal) ReceiveAsync ¶ added in v0.7.1
func (s *RevokeLeaseSignal) ReceiveAsync() *RevokeLeaseRequest
ReceiveAsync checks for a RevokeLease signal without blocking
func (*RevokeLeaseSignal) Select ¶ added in v0.7.1
func (s *RevokeLeaseSignal) Select(sel workflow.Selector, fn func(*RevokeLeaseRequest)) workflow.Selector
Select checks for a RevokeLease signal without blocking
type SampleWorkflowWithMutexChildRun ¶
type SampleWorkflowWithMutexChildRun struct {
Future workflow.ChildWorkflowFuture
}
SampleWorkflowWithMutexChildRun describes a child SampleWorkflowWithMutex workflow run
func SampleWorkflowWithMutexChild ¶
func SampleWorkflowWithMutexChild(ctx workflow.Context, opts *workflow.ChildWorkflowOptions, req *SampleWorkflowWithMutexRequest) *SampleWorkflowWithMutexChildRun
SampleWorkflowWithMutexChild executes a child SampleWorkflowWithMutex workflow
func (*SampleWorkflowWithMutexChildRun) Get ¶
func (r *SampleWorkflowWithMutexChildRun) Get(ctx workflow.Context) (*SampleWorkflowWithMutexResponse, error)
Get blocks until the workflow is completed, returning the response value
func (*SampleWorkflowWithMutexChildRun) LeaseAcquired ¶
func (r *SampleWorkflowWithMutexChildRun) LeaseAcquired(ctx workflow.Context, input *LeaseAcquiredRequest) workflow.Future
LeaseAcquired sends the corresponding signal request to the child workflow
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 {
Req *SampleWorkflowWithMutexRequest
LeaseAcquired *LeaseAcquiredSignal
}
SampleWorkflowWithMutexInput describes the input to a SampleWorkflowWithMutex workflow constructor
type SampleWorkflowWithMutexRequest ¶
type SampleWorkflowWithMutexRequest struct {
Resource string `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"`
Dest string `protobuf:"bytes,2,opt,name=dest,proto3" json:"dest,omitempty"`
Amount float64 `protobuf:"fixed64,3,opt,name=amount,proto3" json:"amount,omitempty"`
// contains filtered or unexported fields
}
SampleWorkflowWithMutexRequest describes the input to a SampleWorkflowWithMutex workflow
func (*SampleWorkflowWithMutexRequest) Descriptor
deprecated
func (*SampleWorkflowWithMutexRequest) Descriptor() ([]byte, []int)
Deprecated: Use SampleWorkflowWithMutexRequest.ProtoReflect.Descriptor instead.
func (*SampleWorkflowWithMutexRequest) GetAmount ¶
func (x *SampleWorkflowWithMutexRequest) GetAmount() float64
func (*SampleWorkflowWithMutexRequest) GetDest ¶
func (x *SampleWorkflowWithMutexRequest) GetDest() string
func (*SampleWorkflowWithMutexRequest) GetResource ¶
func (x *SampleWorkflowWithMutexRequest) GetResource() string
func (*SampleWorkflowWithMutexRequest) ProtoMessage ¶
func (*SampleWorkflowWithMutexRequest) ProtoMessage()
func (*SampleWorkflowWithMutexRequest) ProtoReflect ¶
func (x *SampleWorkflowWithMutexRequest) ProtoReflect() protoreflect.Message
func (*SampleWorkflowWithMutexRequest) Reset ¶
func (x *SampleWorkflowWithMutexRequest) Reset()
func (*SampleWorkflowWithMutexRequest) String ¶
func (x *SampleWorkflowWithMutexRequest) String() string
type SampleWorkflowWithMutexResponse ¶
type SampleWorkflowWithMutexResponse struct {
Result string `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"`
// contains filtered or unexported fields
}
SampleWorkflowWithMutexResponse describes the output from a SampleWorkflowWithMutex workflow
func (*SampleWorkflowWithMutexResponse) Descriptor
deprecated
func (*SampleWorkflowWithMutexResponse) Descriptor() ([]byte, []int)
Deprecated: Use SampleWorkflowWithMutexResponse.ProtoReflect.Descriptor instead.
func (*SampleWorkflowWithMutexResponse) GetResult ¶
func (x *SampleWorkflowWithMutexResponse) GetResult() string
func (*SampleWorkflowWithMutexResponse) ProtoMessage ¶
func (*SampleWorkflowWithMutexResponse) ProtoMessage()
func (*SampleWorkflowWithMutexResponse) ProtoReflect ¶
func (x *SampleWorkflowWithMutexResponse) ProtoReflect() protoreflect.Message
func (*SampleWorkflowWithMutexResponse) Reset ¶
func (x *SampleWorkflowWithMutexResponse) Reset()
func (*SampleWorkflowWithMutexResponse) String ¶
func (x *SampleWorkflowWithMutexResponse) String() string
type SampleWorkflowWithMutexRun ¶
type SampleWorkflowWithMutexRun interface {
// ID returns the workflow ID
ID() string
// RunID returns the workflow instance ID
RunID() string
// Get blocks until the workflow is complete and returns the result
Get(ctx context.Context) (*SampleWorkflowWithMutexResponse, error)
// LeaseAcquired sends a LeaseAcquired signal to the workflow
LeaseAcquired(ctx context.Context, req *LeaseAcquiredRequest) error
}
SampleWorkflowWithMutexRun describes a SampleWorkflowWithMutex workflow run
type SampleWorkflowWithMutexWorkflow ¶
type SampleWorkflowWithMutexWorkflow interface {
// Execute a SampleWorkflowWithMutex workflow
Execute(ctx workflow.Context) (*SampleWorkflowWithMutexResponse, error)
}
SampleWorkflowWithMutex provides an example of a running workflow that uses a Mutex workflow to prevent concurrent access to a shared resource
type Workflows ¶
type Workflows interface {
// Mutex initializes a new MutexWorkflow value
Mutex(ctx workflow.Context, input *MutexInput) (MutexWorkflow, error)
// SampleWorkflowWithMutex initializes a new SampleWorkflowWithMutexWorkflow value
SampleWorkflowWithMutex(ctx workflow.Context, input *SampleWorkflowWithMutexInput) (SampleWorkflowWithMutexWorkflow, error)
}
Workflows provides methods for initializing new Mutex workflow values