Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update client wrappers with new async APIs #1327

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@ type (
// - InternalServiceError
StartWorkflow(ctx context.Context, options StartWorkflowOptions, workflowFunc interface{}, args ...interface{}) (*workflow.Execution, error)

// StartWorkflowAsync behaves like StartWorkflow except that the request is first queued and then processed asynchronously.
// See StartWorkflow for parameter details.
// The returned AsyncWorkflowExecution doesn't contain run ID, because the workflow hasn't started yet.
// The errors it can return:
// - EntityNotExistsError, if domain does not exists
// - BadRequestError
// - InternalServiceError
taylanisikdemir marked this conversation as resolved.
Show resolved Hide resolved
StartWorkflowAsync(ctx context.Context, options StartWorkflowOptions, workflow interface{}, args ...interface{}) (*workflow.ExecutionAsync, error)

// ExecuteWorkflow starts a workflow execution and return a WorkflowRun instance and error
// The user can use this to start using a function or workflow type name.
// Either by
Expand Down Expand Up @@ -169,6 +178,15 @@ type (
SignalWithStartWorkflow(ctx context.Context, workflowID string, signalName string, signalArg interface{},
options StartWorkflowOptions, workflowFunc interface{}, workflowArgs ...interface{}) (*workflow.Execution, error)

// SignalWithStartWorkflowAsync behaves like SignalWithStartWorkflow except that the request is first queued and then processed asynchronously.
// See SignalWithStartWorkflow for parameter details.
// The errors it can return:
// - EntityNotExistsError, if domain does not exist
// - BadRequestError
// - InternalServiceError
taylanisikdemir marked this conversation as resolved.
Show resolved Hide resolved
SignalWithStartWorkflowAsync(ctx context.Context, workflowID string, signalName string, signalArg interface{},
options StartWorkflowOptions, workflow interface{}, workflowArgs ...interface{}) (*workflow.ExecutionAsync, error)

// CancelWorkflow cancels a workflow in execution
// - workflow ID of the workflow.
// - runID can be default(empty string). if empty string then it will pick the running execution of that workflow ID.
Expand Down
18 changes: 18 additions & 0 deletions internal/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,15 @@ type (
// subjected to change in the future.
StartWorkflow(ctx context.Context, options StartWorkflowOptions, workflow interface{}, args ...interface{}) (*WorkflowExecution, error)

// StartWorkflowAsync behaves like StartWorkflow except that the request is first queued and then processed asynchronously.
// See StartWorkflow for parameter details.
// The returned AsyncWorkflowExecution doesn't contain run ID, because the workflow hasn't started yet.
// The errors it can return:
// - EntityNotExistsError, if domain does not exists
// - BadRequestError
// - InternalServiceError
StartWorkflowAsync(ctx context.Context, options StartWorkflowOptions, workflow interface{}, args ...interface{}) (*WorkflowExecutionAsync, error)

// ExecuteWorkflow starts a workflow execution and return a WorkflowRun instance and error
// The user can use this to start using a function or workflow type name.
// Either by
Expand Down Expand Up @@ -160,6 +169,15 @@ type (
SignalWithStartWorkflow(ctx context.Context, workflowID string, signalName string, signalArg interface{},
options StartWorkflowOptions, workflow interface{}, workflowArgs ...interface{}) (*WorkflowExecution, error)

// SignalWithStartWorkflowAsync behaves like SignalWithStartWorkflow except that the request is first queued and then processed asynchronously.
// See SignalWithStartWorkflow for parameter details.
// The errors it can return:
// - EntityNotExistsError, if domain does not exist
// - BadRequestError
// - InternalServiceError
SignalWithStartWorkflowAsync(ctx context.Context, workflowID string, signalName string, signalArg interface{},
options StartWorkflowOptions, workflow interface{}, workflowArgs ...interface{}) (*WorkflowExecutionAsync, error)

// CancelWorkflow cancels a workflow in execution
// - workflow ID of the workflow.
// - runID can be default(empty string). if empty string then it will pick the running execution of that workflow ID.
Expand Down
28 changes: 15 additions & 13 deletions internal/common/metrics/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,21 @@ package metrics

// Workflow Creation metrics
const (
CadenceMetricsPrefix = "cadence-"
WorkflowStartCounter = CadenceMetricsPrefix + "workflow-start"
WorkflowCompletedCounter = CadenceMetricsPrefix + "workflow-completed"
WorkflowCanceledCounter = CadenceMetricsPrefix + "workflow-canceled"
WorkflowFailedCounter = CadenceMetricsPrefix + "workflow-failed"
WorkflowContinueAsNewCounter = CadenceMetricsPrefix + "workflow-continue-as-new"
WorkflowEndToEndLatency = CadenceMetricsPrefix + "workflow-endtoend-latency" // measure workflow execution from start to close
WorkflowGetHistoryCounter = CadenceMetricsPrefix + "workflow-get-history-total"
WorkflowGetHistoryFailedCounter = CadenceMetricsPrefix + "workflow-get-history-failed"
WorkflowGetHistorySucceedCounter = CadenceMetricsPrefix + "workflow-get-history-succeed"
WorkflowGetHistoryLatency = CadenceMetricsPrefix + "workflow-get-history-latency"
WorkflowSignalWithStartCounter = CadenceMetricsPrefix + "workflow-signal-with-start"
DecisionTimeoutCounter = CadenceMetricsPrefix + "decision-timeout"
CadenceMetricsPrefix = "cadence-"
WorkflowStartCounter = CadenceMetricsPrefix + "workflow-start"
WorkflowStartAsyncCounter = CadenceMetricsPrefix + "workflow-start-async"
WorkflowCompletedCounter = CadenceMetricsPrefix + "workflow-completed"
WorkflowCanceledCounter = CadenceMetricsPrefix + "workflow-canceled"
WorkflowFailedCounter = CadenceMetricsPrefix + "workflow-failed"
WorkflowContinueAsNewCounter = CadenceMetricsPrefix + "workflow-continue-as-new"
WorkflowEndToEndLatency = CadenceMetricsPrefix + "workflow-endtoend-latency" // measure workflow execution from start to close
WorkflowGetHistoryCounter = CadenceMetricsPrefix + "workflow-get-history-total"
WorkflowGetHistoryFailedCounter = CadenceMetricsPrefix + "workflow-get-history-failed"
WorkflowGetHistorySucceedCounter = CadenceMetricsPrefix + "workflow-get-history-succeed"
WorkflowGetHistoryLatency = CadenceMetricsPrefix + "workflow-get-history-latency"
WorkflowSignalWithStartCounter = CadenceMetricsPrefix + "workflow-signal-with-start"
WorkflowSignalWithStartAsyncCounter = CadenceMetricsPrefix + "workflow-signal-with-start-async"
DecisionTimeoutCounter = CadenceMetricsPrefix + "decision-timeout"

DecisionPollCounter = CadenceMetricsPrefix + "decision-poll-total"
DecisionPollFailedCounter = CadenceMetricsPrefix + "decision-poll-failed"
Expand Down
Loading
Loading