1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
// Many of the messages in here are exact or near duplicates of the protobufs defined by the // Temporal API. We dupe them here to introduce better ergonomics wherever possible, and to // decouple ourselves from upstream changes. Additionally, we have no need for wire compatibility // between core and lang sdks, since the lang SDK chooses which version of core it wants to use. /// Used as arguments to activities, signals, queries, etc. #[derive(Clone, PartialEq, ::prost::Message)] pub struct Payload { #[prost(map = "string, bytes", tag = "1")] pub metadata: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::vec::Vec<u8>>, #[prost(bytes = "vec", tag = "2")] pub data: ::prost::alloc::vec::Vec<u8>, } /// Identifying information about a particular workflow execution #[derive(Clone, PartialEq, ::prost::Message)] pub struct WorkflowExecution { #[prost(string, tag = "1")] pub workflow_id: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub run_id: ::prost::alloc::string::String, } /// Defines how an activity or workflow should be retried in the event of failure, timeout, etc. #[derive(Clone, PartialEq, ::prost::Message)] pub struct RetryPolicy { /// Interval of the first retry. If backoff_coefficient is 1.0 then it is used for all /// retries. #[prost(message, optional, tag = "1")] pub initial_interval: ::core::option::Option<::prost_types::Duration>, /// Coefficient used to calculate the next retry interval. The next retry interval is previous /// interval multiplied by the coefficient. Must be 1 or larger. #[prost(double, tag = "2")] pub backoff_coefficient: f64, /// Maximum interval between retries. Exponential backoff leads to interval increase. This value /// caps that interval. Default is 100x of the initial interval. #[prost(message, optional, tag = "3")] pub maximum_interval: ::core::option::Option<::prost_types::Duration>, /// Maximum number of attempts. When exceeded, retrying will stop. 1 disables retries. 0 means /// unlimited retries (until the activity or workflow's total timeout is reached). #[prost(int32, tag = "4")] pub maximum_attempts: i32, /// If a stringified error matches something in this list, retries will cease. #[prost(string, repeated, tag = "5")] pub non_retryable_error_types: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } /// Represents a failure in user code, workflow or activity, which could've been triggered by /// an exception or similar error mechanism like the error half of a Result type. /// /// This eventually needs to be converted into an upstream `Failure` which needs to handle a lot /// more cases that the lang sdk does not care about. By default any lang sdk failure is an upstream /// `ApplicationFailureInfo`. #[derive(Clone, PartialEq, ::prost::Message)] pub struct UserCodeFailure { /// Human-specified or otherwise most-human-readable representation of the error. #[prost(string, tag = "1")] pub message: ::prost::alloc::string::String, /// A type identifier for the error, if the error is well-typed. #[prost(string, tag = "2")] pub r#type: ::prost::alloc::string::String, /// If known, the location the error was issued at. #[prost(string, tag = "3")] pub source: ::prost::alloc::string::String, /// If collected, a stack trace for the error. #[prost(string, tag = "4")] pub stack_trace: ::prost::alloc::string::String, /// Explicitly thrown user errors are able to indicate that retries should be prevented #[prost(bool, tag = "5")] pub non_retryable: bool, #[prost(message, optional, boxed, tag = "6")] pub cause: ::core::option::Option<::prost::alloc::boxed::Box<UserCodeFailure>>, }