-
Notifications
You must be signed in to change notification settings - Fork 76
[DO NOT MERGE] Add standalone activity APIs #640
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
Draft
bergundy
wants to merge
1
commit into
temporalio:master
Choose a base branch
from
bergundy:standalone-activity
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
syntax = "proto3"; | ||
|
||
package temporal.api.enums.v1; | ||
|
||
option go_package = "go.temporal.io/api/enums/v1;enums"; | ||
option java_package = "io.temporal.api.enums.v1"; | ||
option java_multiple_files = true; | ||
option java_outer_classname = "ActivityProto"; | ||
option ruby_package = "Temporalio::Api::Enums::V1"; | ||
option csharp_namespace = "Temporalio.Api.Enums.V1"; | ||
|
||
// Status of a standalone activity. | ||
// The status is updated once, when the activity is originally scheduled, and again when the activity reaches a terminal | ||
// status. | ||
// TODO: Should this be a common execution status? Seems like the other archetypes will share this status. | ||
// (-- api-linter: core::0216::synonyms=disabled | ||
// aip.dev/not-precedent: Named consistently with WorkflowExecutionStatus. --) | ||
enum ActivityExecutionStatus { | ||
ACTIVITY_EXECUTION_STATUS_UNSPECIFIED = 0; | ||
// The activity is not in a terminal status. This does not necessarily mean that there is a currently running | ||
// attempt. The activity may be backing off between attempts or waiting for a worker to pick it up. | ||
ACTIVITY_EXECUTION_STATUS_RUNNING = 1; | ||
// The activity completed successfully. | ||
ACTIVITY_EXECUTION_STATUS_COMPLETED = 2; | ||
// The activity completed with failure. | ||
ACTIVITY_EXECUTION_STATUS_FAILED = 3; | ||
// The activity completed as canceled. | ||
// Requesting to cancel an activity does not automatically transition the activity to canceled status. If the | ||
// activity has a currently running attempt, the activity will only transition to canceled status if the current | ||
// attempt is unsuccessful. | ||
// TODO: Clarify what happens if there are no more allowed retries after the current attempt. | ||
ACTIVITY_EXECUTION_STATUS_CANCELED = 4; | ||
// The activity was terminated. Termination does not reach the worker and the activity code cannot react to it. | ||
// A terminated activity may have a running attempt and will be requested to be canceled by the server when it | ||
// heartbeats. | ||
ACTIVITY_EXECUTION_STATUS_TERMINATED = 5; | ||
// The activity has timed out by reaching the specified shedule-to-start or schedule-to-close timeouts. | ||
// TODO: Clarify if there are other conditions where the activity can end up in timed out status. | ||
ACTIVITY_EXECUTION_STATUS_TIMED_OUT = 6; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
syntax = "proto3"; | ||
|
||
package temporal.api.enums.v1; | ||
|
||
option go_package = "go.temporal.io/api/enums/v1;enums"; | ||
option java_package = "io.temporal.api.enums.v1"; | ||
option java_multiple_files = true; | ||
option java_outer_classname = "IdProto"; | ||
option ruby_package = "Temporalio::Api::Enums::V1"; | ||
option csharp_namespace = "Temporalio.Api.Enums.V1"; | ||
|
||
// Defines whether to allow re-using an ID from a previously *closed* execution. | ||
// If the request is denied, the server returns an `ExecutionAlreadyStarted` error. | ||
// | ||
// See `IdConflictPolicy` for handling ID duplication with a *running* execution. | ||
enum IdReusePolicy { | ||
ID_REUSE_POLICY_UNSPECIFIED = 0; | ||
// Always allow starting an execution using the same entity ID. | ||
ID_REUSE_POLICY_ALLOW_DUPLICATE = 1; | ||
// Allow starting an execution using the same ID, only when the last execution's final state is one of [terminated, | ||
// cancelled, timed out, failed]. | ||
ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY = 2; | ||
// Do not permit re-use of the ID for this execution. Future start requests could potentially change the policy, | ||
// allowing re-use of the ID. | ||
ID_REUSE_POLICY_REJECT_DUPLICATE = 3; | ||
} | ||
|
||
// Defines what to do when trying to start an execution with the same ID as a *running* execution. | ||
// Note that it is *never* valid to have two actively running instances of the same execution ID. | ||
// | ||
// See `IdReusePolicy` for handling execution ID duplication with a *closed* execution. | ||
enum IdConflictPolicy { | ||
ID_CONFLICT_POLICY_UNSPECIFIED = 0; | ||
// Don't start a new execution; instead return `ExecutionAlreadyStarted` error. | ||
ID_CONFLICT_POLICY_FAIL = 1; | ||
// Don't start a new execution; instead return a handle for the running execution. | ||
ID_CONFLICT_POLICY_USE_EXISTING = 2; | ||
// Terminate the running execution before starting a new one. | ||
ID_CONFLICT_POLICY_TERMINATE_EXISTING = 3; | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will likely add a
PAUSED
status here since this is the direction workflow pause is going.