Skip to content

Commit

Permalink
Support ApplicationFailureException.NextRetryDelay (#254)
Browse files Browse the repository at this point in the history
Fixes #186
  • Loading branch information
cretz authored May 28, 2024
1 parent 1645178 commit ef70705
Show file tree
Hide file tree
Showing 31 changed files with 28,297 additions and 4,811 deletions.
1,103 changes: 914 additions & 189 deletions src/Temporalio/Api/Command/V1/Message.cs

Large diffs are not rendered by default.

578 changes: 520 additions & 58 deletions src/Temporalio/Api/Common/V1/Message.cs

Large diffs are not rendered by default.

14 changes: 9 additions & 5 deletions src/Temporalio/Api/Enums/V1/CommandType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static CommandTypeReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Cih0ZW1wb3JhbC9hcGkvZW51bXMvdjEvY29tbWFuZF90eXBlLnByb3RvEhV0",
"ZW1wb3JhbC5hcGkuZW51bXMudjEqwAUKC0NvbW1hbmRUeXBlEhwKGENPTU1B",
"ZW1wb3JhbC5hcGkuZW51bXMudjEqnAYKC0NvbW1hbmRUeXBlEhwKGENPTU1B",
"TkRfVFlQRV9VTlNQRUNJRklFRBAAEicKI0NPTU1BTkRfVFlQRV9TQ0hFRFVM",
"RV9BQ1RJVklUWV9UQVNLEAESLQopQ09NTUFORF9UWVBFX1JFUVVFU1RfQ0FO",
"Q0VMX0FDVElWSVRZX1RBU0sQAhIcChhDT01NQU5EX1RZUEVfU1RBUlRfVElN",
Expand All @@ -41,10 +41,12 @@ static CommandTypeReflection() {
"WEVDVVRJT04QDBIyCi5DT01NQU5EX1RZUEVfVVBTRVJUX1dPUktGTE9XX1NF",
"QVJDSF9BVFRSSUJVVEVTEA0SIQodQ09NTUFORF9UWVBFX1BST1RPQ09MX01F",
"U1NBR0UQDhIrCidDT01NQU5EX1RZUEVfTU9ESUZZX1dPUktGTE9XX1BST1BF",
"UlRJRVMQEEKIAQoYaW8udGVtcG9yYWwuYXBpLmVudW1zLnYxQhBDb21tYW5k",
"VHlwZVByb3RvUAFaIWdvLnRlbXBvcmFsLmlvL2FwaS9lbnVtcy92MTtlbnVt",
"c6oCF1RlbXBvcmFsaW8uQXBpLkVudW1zLlYx6gIaVGVtcG9yYWxpbzo6QXBp",
"OjpFbnVtczo6VjFiBnByb3RvMw=="));
"UlRJRVMQEBIpCiVDT01NQU5EX1RZUEVfU0NIRURVTEVfTkVYVVNfT1BFUkFU",
"SU9OEBESLworQ09NTUFORF9UWVBFX1JFUVVFU1RfQ0FOQ0VMX05FWFVTX09Q",
"RVJBVElPThASQogBChhpby50ZW1wb3JhbC5hcGkuZW51bXMudjFCEENvbW1h",
"bmRUeXBlUHJvdG9QAVohZ28udGVtcG9yYWwuaW8vYXBpL2VudW1zL3YxO2Vu",
"dW1zqgIXVGVtcG9yYWxpby5BcGkuRW51bXMuVjHqAhpUZW1wb3JhbGlvOjpB",
"cGk6OkVudW1zOjpWMWIGcHJvdG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Temporalio.Api.Enums.V1.CommandType), }, null, null));
Expand Down Expand Up @@ -73,6 +75,8 @@ public enum CommandType {
[pbr::OriginalName("COMMAND_TYPE_UPSERT_WORKFLOW_SEARCH_ATTRIBUTES")] UpsertWorkflowSearchAttributes = 13,
[pbr::OriginalName("COMMAND_TYPE_PROTOCOL_MESSAGE")] ProtocolMessage = 14,
[pbr::OriginalName("COMMAND_TYPE_MODIFY_WORKFLOW_PROPERTIES")] ModifyWorkflowProperties = 16,
[pbr::OriginalName("COMMAND_TYPE_SCHEDULE_NEXUS_OPERATION")] ScheduleNexusOperation = 17,
[pbr::OriginalName("COMMAND_TYPE_REQUEST_CANCEL_NEXUS_OPERATION")] RequestCancelNexusOperation = 18,
}

#endregion
Expand Down
109 changes: 104 additions & 5 deletions src/Temporalio/Api/Enums/V1/Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,30 @@ static CommonReflection() {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05l",
"eHVzT3BlcmF0aW9uQ2FuY2VsbGF0aW9uU3RhdGUSMgouTkVYVVNfT1BFUkFU",
"SU9OX0NBTkNFTExBVElPTl9TVEFURV9VTlNQRUNJRklFRBAAEjAKLE5FWFVT",
"X09QRVJBVElPTl9DQU5DRUxMQVRJT05fU1RBVEVfU0NIRURVTEVEEAESMgou",
"TkVYVVNfT1BFUkFUSU9OX0NBTkNFTExBVElPTl9TVEFURV9CQUNLSU5HX09G",
"RhACEjAKLE5FWFVTX09QRVJBVElPTl9DQU5DRUxMQVRJT05fU1RBVEVfU1VD",
"Q0VFREVEEAMSLQopTkVYVVNfT1BFUkFUSU9OX0NBTkNFTExBVElPTl9TVEFU",
"RV9GQUlMRUQQBBIwCixORVhVU19PUEVSQVRJT05fQ0FOQ0VMTEFUSU9OX1NU",
"QVRFX1RJTUVEX09VVBAFQoMBChhpby50ZW1wb3JhbC5hcGkuZW51bXMudjFC",
"C0NvbW1vblByb3RvUAFaIWdvLnRlbXBvcmFsLmlvL2FwaS9lbnVtcy92MTtl",
"bnVtc6oCF1RlbXBvcmFsaW8uQXBpLkVudW1zLlYx6gIaVGVtcG9yYWxpbzo6",
"QXBpOjpFbnVtczo6VjFiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Temporalio.Api.Enums.V1.EncodingType), typeof(global::Temporalio.Api.Enums.V1.IndexedValueType), typeof(global::Temporalio.Api.Enums.V1.Severity), }, null, null));
new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Temporalio.Api.Enums.V1.EncodingType), typeof(global::Temporalio.Api.Enums.V1.IndexedValueType), typeof(global::Temporalio.Api.Enums.V1.Severity), typeof(global::Temporalio.Api.Enums.V1.CallbackState), typeof(global::Temporalio.Api.Enums.V1.PendingNexusOperationState), typeof(global::Temporalio.Api.Enums.V1.NexusOperationCancellationState), }, null, null));
}
#endregion

Expand Down Expand Up @@ -71,6 +88,88 @@ public enum Severity {
[pbr::OriginalName("SEVERITY_LOW")] Low = 3,
}

/// <summary>
/// State of a callback.
/// </summary>
public enum CallbackState {
/// <summary>
/// Default value, unspecified state.
/// </summary>
[pbr::OriginalName("CALLBACK_STATE_UNSPECIFIED")] Unspecified = 0,
/// <summary>
/// Callback is standing by, waiting to be triggered.
/// </summary>
[pbr::OriginalName("CALLBACK_STATE_STANDBY")] Standby = 1,
/// <summary>
/// Callback is in the queue waiting to be executed or is currently executing.
/// </summary>
[pbr::OriginalName("CALLBACK_STATE_SCHEDULED")] Scheduled = 2,
/// <summary>
/// Callback has failed with a retryable error and is backing off before the next attempt.
/// </summary>
[pbr::OriginalName("CALLBACK_STATE_BACKING_OFF")] BackingOff = 3,
/// <summary>
/// Callback has failed.
/// </summary>
[pbr::OriginalName("CALLBACK_STATE_FAILED")] Failed = 4,
/// <summary>
/// Callback has succeeded.
/// </summary>
[pbr::OriginalName("CALLBACK_STATE_SUCCEEDED")] Succeeded = 5,
}

/// <summary>
/// State of a pending Nexus operation.
/// </summary>
public enum PendingNexusOperationState {
/// <summary>
/// Default value, unspecified state.
/// </summary>
[pbr::OriginalName("PENDING_NEXUS_OPERATION_STATE_UNSPECIFIED")] Unspecified = 0,
/// <summary>
/// Operation is in the queue waiting to be executed or is currently executing.
/// </summary>
[pbr::OriginalName("PENDING_NEXUS_OPERATION_STATE_SCHEDULED")] Scheduled = 1,
/// <summary>
/// Operation has failed with a retryable error and is backing off before the next attempt.
/// </summary>
[pbr::OriginalName("PENDING_NEXUS_OPERATION_STATE_BACKING_OFF")] BackingOff = 2,
/// <summary>
/// Operation was started and will complete asynchronously.
/// </summary>
[pbr::OriginalName("PENDING_NEXUS_OPERATION_STATE_STARTED")] Started = 3,
}

/// <summary>
/// State of a Nexus operation cancellation.
/// </summary>
public enum NexusOperationCancellationState {
/// <summary>
/// Default value, unspecified state.
/// </summary>
[pbr::OriginalName("NEXUS_OPERATION_CANCELLATION_STATE_UNSPECIFIED")] Unspecified = 0,
/// <summary>
/// Cancellation request is in the queue waiting to be executed or is currently executing.
/// </summary>
[pbr::OriginalName("NEXUS_OPERATION_CANCELLATION_STATE_SCHEDULED")] Scheduled = 1,
/// <summary>
/// Cancellation request has failed with a retryable error and is backing off before the next attempt.
/// </summary>
[pbr::OriginalName("NEXUS_OPERATION_CANCELLATION_STATE_BACKING_OFF")] BackingOff = 2,
/// <summary>
/// Cancellation request succeeded.
/// </summary>
[pbr::OriginalName("NEXUS_OPERATION_CANCELLATION_STATE_SUCCEEDED")] Succeeded = 3,
/// <summary>
/// Cancellation request failed with a non-retryable error.
/// </summary>
[pbr::OriginalName("NEXUS_OPERATION_CANCELLATION_STATE_FAILED")] Failed = 4,
/// <summary>
/// The associated operation timed out - exceeded the user supplied schedule-to-close timeout.
/// </summary>
[pbr::OriginalName("NEXUS_OPERATION_CANCELLATION_STATE_TIMED_OUT")] TimedOut = 5,
}

#endregion

}
Expand Down
53 changes: 44 additions & 9 deletions src/Temporalio/Api/Enums/V1/EventType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static EventTypeReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CiZ0ZW1wb3JhbC9hcGkvZW51bXMvdjEvZXZlbnRfdHlwZS5wcm90bxIVdGVt",
"cG9yYWwuYXBpLmVudW1zLnYxKsIRCglFdmVudFR5cGUSGgoWRVZFTlRfVFlQ",
"cG9yYWwuYXBpLmVudW1zLnYxKugTCglFdmVudFR5cGUSGgoWRVZFTlRfVFlQ",
"RV9VTlNQRUNJRklFRBAAEikKJUVWRU5UX1RZUEVfV09SS0ZMT1dfRVhFQ1VU",
"SU9OX1NUQVJURUQQARIrCidFVkVOVF9UWVBFX1dPUktGTE9XX0VYRUNVVElP",
"Tl9DT01QTEVURUQQAhIoCiRFVkVOVF9UWVBFX1dPUktGTE9XX0VYRUNVVElP",
Expand Down Expand Up @@ -74,11 +74,18 @@ static EventTypeReflection() {
"T1J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bXMvdjE7ZW51bXOqAhdUZW1wb3JhbGlvLkFw",
"aS5FbnVtcy5WMeoCGlRlbXBvcmFsaW86OkFwaTo6RW51bXM6OlYxYgZwcm90",
"bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Temporalio.Api.Enums.V1.EventType), }, null, null));
Expand Down Expand Up @@ -320,11 +327,39 @@ public enum EventType {
/// </summary>
[pbr::OriginalName("EVENT_TYPE_WORKFLOW_PROPERTIES_MODIFIED")] WorkflowPropertiesModified = 46,
/// <summary>
/// An update was requested. Note that not all update requests result in this
/// event. See UpdateRequestedEventOrigin for situations in which this event
/// An update was admitted. Note that not all admitted updates result in this
/// event. See UpdateAdmittedEventOrigin for situations in which this event
/// is created.
/// </summary>
[pbr::OriginalName("EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_REQUESTED")] WorkflowExecutionUpdateRequested = 47,
[pbr::OriginalName("EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_ADMITTED")] WorkflowExecutionUpdateAdmitted = 47,
/// <summary>
/// A Nexus operation was scheduled using a ScheduleNexusOperation command.
/// </summary>
[pbr::OriginalName("EVENT_TYPE_NEXUS_OPERATION_SCHEDULED")] NexusOperationScheduled = 48,
/// <summary>
/// An asynchronous Nexus operation was started by a Nexus handler.
/// </summary>
[pbr::OriginalName("EVENT_TYPE_NEXUS_OPERATION_STARTED")] NexusOperationStarted = 49,
/// <summary>
/// A Nexus operation completed successfully.
/// </summary>
[pbr::OriginalName("EVENT_TYPE_NEXUS_OPERATION_COMPLETED")] NexusOperationCompleted = 50,
/// <summary>
/// A Nexus operation failed.
/// </summary>
[pbr::OriginalName("EVENT_TYPE_NEXUS_OPERATION_FAILED")] NexusOperationFailed = 51,
/// <summary>
/// A Nexus operation completed as canceled.
/// </summary>
[pbr::OriginalName("EVENT_TYPE_NEXUS_OPERATION_CANCELED")] NexusOperationCanceled = 52,
/// <summary>
/// A Nexus operation timed out.
/// </summary>
[pbr::OriginalName("EVENT_TYPE_NEXUS_OPERATION_TIMED_OUT")] NexusOperationTimedOut = 53,
/// <summary>
/// A Nexus operation was requested to be canceled using a RequestCancelNexusOperation command.
/// </summary>
[pbr::OriginalName("EVENT_TYPE_NEXUS_OPERATION_CANCEL_REQUESTED")] NexusOperationCancelRequested = 54,
}

#endregion
Expand Down
Loading

0 comments on commit ef70705

Please sign in to comment.