1#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct Envelope {
4 #[prost(string, tag = "1")]
6 pub id: ::prost::alloc::string::String,
7 #[prost(string, tag = "2")]
9 pub kind: ::prost::alloc::string::String,
10 #[prost(uint32, tag = "3")]
12 pub schema_version: u32,
13 #[prost(bytes = "vec", tag = "4")]
15 pub payload: ::prost::alloc::vec::Vec<u8>,
16 #[prost(string, tag = "5")]
17 pub queue: ::prost::alloc::string::String,
18 #[prost(string, tag = "6")]
20 pub partition_key: ::prost::alloc::string::String,
21 #[prost(string, tag = "7")]
23 pub rate_class: ::prost::alloc::string::String,
24 #[prost(string, tag = "8")]
26 pub fingerprint: ::prost::alloc::string::String,
27 #[prost(uint32, tag = "9")]
29 pub attempt: u32,
30 #[prost(uint32, tag = "10")]
32 pub crash_attempt: u32,
33 #[prost(uint32, tag = "11")]
34 pub max_attempts: u32,
35 #[prost(int32, tag = "12")]
37 pub priority: i32,
38 #[prost(int64, tag = "13")]
40 pub enqueued_at_ms: i64,
41 #[prost(int64, tag = "14")]
42 pub scheduled_at_ms: i64,
43 #[prost(int64, tag = "15")]
45 pub timeout_ms: i64,
46 #[prost(int64, tag = "16")]
48 pub deadline_ms: i64,
49 #[prost(int64, tag = "17")]
50 pub retention_ms: i64,
51 #[prost(bytes = "vec", tag = "18")]
53 pub unique_key: ::prost::alloc::vec::Vec<u8>,
54 #[prost(uint32, tag = "19")]
56 pub unique_states: u32,
57 #[prost(map = "string, string", tag = "20")]
58 pub headers: ::std::collections::HashMap<
59 ::prost::alloc::string::String,
60 ::prost::alloc::string::String,
61 >,
62 #[prost(message, repeated, tag = "21")]
63 pub errors: ::prost::alloc::vec::Vec<AttemptError>,
64 #[prost(int64, tag = "22")]
67 pub unique_window_ms: i64,
68 #[prost(message, optional, tag = "23")]
70 pub checkpoint: ::core::option::Option<Checkpoint>,
71 #[prost(uint32, tag = "24")]
75 pub weight: u32,
76 #[prost(string, tag = "25")]
79 pub periodic_schedule_id: ::prost::alloc::string::String,
80 #[prost(int64, tag = "26")]
81 pub periodic_tick_ms: i64,
82 #[prost(uint32, tag = "27")]
85 pub unique_replace: u32,
86 #[prost(int64, tag = "28")]
90 pub unique_debounce_ms: i64,
91 #[prost(bool, tag = "29")]
94 pub unique_exclude_kind: bool,
95 #[prost(string, repeated, tag = "30")]
97 pub tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
98 #[prost(bool, tag = "31")]
100 pub pending: bool,
101 #[prost(string, tag = "32")]
104 pub sticky_worker: ::prost::alloc::string::String,
105}
106#[derive(Clone, PartialEq, ::prost::Message)]
111pub struct Checkpoint {
112 #[prost(string, tag = "1")]
113 pub last_completed_step: ::prost::alloc::string::String,
114 #[prost(string, tag = "2")]
116 pub cursor_step: ::prost::alloc::string::String,
117 #[prost(bytes = "vec", tag = "3")]
119 pub cursor: ::prost::alloc::vec::Vec<u8>,
120 #[prost(int64, tag = "4")]
121 pub updated_at_ms: i64,
122 #[prost(uint32, tag = "5")]
127 pub schema_version: u32,
128 #[prost(string, tag = "6")]
129 pub step_set_hash: ::prost::alloc::string::String,
130 #[prost(map = "string, uint32", tag = "7")]
132 pub crashes_by_step: ::std::collections::HashMap<
133 ::prost::alloc::string::String,
134 u32,
135 >,
136}
137#[derive(Clone, PartialEq, ::prost::Message)]
138pub struct AttemptError {
139 #[prost(uint32, tag = "1")]
140 pub attempt: u32,
141 #[prost(int64, tag = "2")]
142 pub at_ms: i64,
143 #[prost(string, tag = "3")]
144 pub message: ::prost::alloc::string::String,
145 #[prost(enumeration = "Outcome", tag = "4")]
146 pub outcome: i32,
147 #[prost(bool, tag = "5")]
148 pub was_panic: bool,
149 #[prost(string, tag = "6")]
150 pub worker: ::prost::alloc::string::String,
151 #[prost(string, tag = "7")]
153 pub step: ::prost::alloc::string::String,
154}
155#[derive(Clone, PartialEq, ::prost::Message)]
156pub struct Claim {
157 #[prost(message, optional, tag = "1")]
158 pub envelope: ::core::option::Option<Envelope>,
159 #[prost(string, tag = "2")]
161 pub lease_id: ::prost::alloc::string::String,
162 #[prost(int64, tag = "3")]
163 pub lease_expires_at_ms: i64,
164 #[prost(uint64, tag = "4")]
166 pub fence: u64,
167}
168#[derive(Clone, PartialEq, ::prost::Message)]
169pub struct WorkerInfo {
170 #[prost(string, tag = "1")]
171 pub worker_id: ::prost::alloc::string::String,
172 #[prost(string, tag = "2")]
173 pub host: ::prost::alloc::string::String,
174 #[prost(int32, tag = "3")]
175 pub pid: i32,
176 #[prost(string, tag = "4")]
177 pub version: ::prost::alloc::string::String,
178 #[prost(string, repeated, tag = "5")]
179 pub queues: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
180 #[prost(uint32, tag = "6")]
181 pub concurrency: u32,
182 #[prost(int64, tag = "7")]
183 pub started_at_ms: i64,
184 #[prost(int64, tag = "8")]
185 pub heartbeat_at_ms: i64,
186 #[prost(uint32, tag = "9")]
187 pub inflight: u32,
188 #[prost(string, tag = "10")]
189 pub status: ::prost::alloc::string::String,
190 #[prost(bool, tag = "11")]
191 pub duties_active: bool,
192 #[prost(string, tag = "12")]
193 pub pending_command: ::prost::alloc::string::String,
194}
195#[derive(Clone, PartialEq, ::prost::Message)]
197pub struct RateClass {
198 #[prost(string, tag = "1")]
199 pub name: ::prost::alloc::string::String,
200 #[prost(uint64, tag = "2")]
202 pub limit: u64,
203 #[prost(int64, tag = "3")]
204 pub window_ms: i64,
205 #[prost(uint64, tag = "4")]
206 pub burst: u64,
207}
208#[derive(Clone, PartialEq, ::prost::Message)]
209pub struct ConcurrencyLimit {
210 #[prost(string, tag = "1")]
211 pub name: ::prost::alloc::string::String,
212 #[prost(string, tag = "2")]
214 pub partition_by: ::prost::alloc::string::String,
215 #[prost(uint64, tag = "3")]
216 pub max_concurrent: u64,
217 #[prost(string, tag = "4")]
218 pub queue: ::prost::alloc::string::String,
219 #[prost(string, tag = "5")]
221 pub on_saturated: ::prost::alloc::string::String,
222}
223#[derive(Clone, PartialEq, ::prost::Message)]
225pub struct QueueStats {
226 #[prost(string, tag = "1")]
227 pub queue: ::prost::alloc::string::String,
228 #[prost(map = "string, uint64", tag = "2")]
229 pub by_state: ::std::collections::HashMap<::prost::alloc::string::String, u64>,
230 #[prost(double, tag = "3")]
232 pub arrival_rate: f64,
233 #[prost(double, tag = "4")]
235 pub drain_rate: f64,
236 #[prost(int64, tag = "5")]
238 pub time_to_drain_ms: i64,
239 #[prost(bool, tag = "6")]
240 pub paused: bool,
241 #[prost(bool, tag = "7")]
243 pub count_is_approximate: bool,
244 #[prost(int64, tag = "8")]
246 pub oldest_available_ms: i64,
247 #[prost(message, optional, tag = "9")]
248 pub quiet_groups: ::core::option::Option<QuietGroupMetrics>,
249 #[prost(uint32, tag = "10")]
251 pub weight: u32,
252 #[prost(uint64, tag = "11")]
254 pub unfinished_jobs: u64,
255 #[prost(uint64, optional, tag = "12")]
257 pub max_unfinished_jobs: ::core::option::Option<u64>,
258}
259#[derive(Clone, Copy, PartialEq, ::prost::Message)]
260pub struct QuietGroupMetrics {
261 #[prost(double, tag = "1")]
262 pub arrival_rate: f64,
263 #[prost(double, tag = "2")]
264 pub drain_rate: f64,
265 #[prost(int64, tag = "3")]
267 pub time_to_drain_ms: i64,
268 #[prost(int64, tag = "4")]
270 pub oldest_available_ms: i64,
271 #[prost(uint32, tag = "5")]
272 pub noisy_partitions: u32,
273 #[prost(bool, tag = "6")]
274 pub approximate: bool,
275}
276#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
278#[repr(i32)]
279pub enum State {
280 Unspecified = 0,
281 Scheduled = 1,
283 Available = 2,
285 Running = 3,
287 Retryable = 4,
289 Completed = 5,
291 Archived = 6,
293 Cancelled = 7,
295 Quarantined = 8,
297 Undecodable = 9,
299 Pending = 10,
301}
302impl State {
303 pub fn as_str_name(&self) -> &'static str {
308 match self {
309 Self::Unspecified => "STATE_UNSPECIFIED",
310 Self::Scheduled => "STATE_SCHEDULED",
311 Self::Available => "STATE_AVAILABLE",
312 Self::Running => "STATE_RUNNING",
313 Self::Retryable => "STATE_RETRYABLE",
314 Self::Completed => "STATE_COMPLETED",
315 Self::Archived => "STATE_ARCHIVED",
316 Self::Cancelled => "STATE_CANCELLED",
317 Self::Quarantined => "STATE_QUARANTINED",
318 Self::Undecodable => "STATE_UNDECODABLE",
319 Self::Pending => "STATE_PENDING",
320 }
321 }
322 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
324 match value {
325 "STATE_UNSPECIFIED" => Some(Self::Unspecified),
326 "STATE_SCHEDULED" => Some(Self::Scheduled),
327 "STATE_AVAILABLE" => Some(Self::Available),
328 "STATE_RUNNING" => Some(Self::Running),
329 "STATE_RETRYABLE" => Some(Self::Retryable),
330 "STATE_COMPLETED" => Some(Self::Completed),
331 "STATE_ARCHIVED" => Some(Self::Archived),
332 "STATE_CANCELLED" => Some(Self::Cancelled),
333 "STATE_QUARANTINED" => Some(Self::Quarantined),
334 "STATE_UNDECODABLE" => Some(Self::Undecodable),
335 "STATE_PENDING" => Some(Self::Pending),
336 _ => None,
337 }
338 }
339}
340#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
341#[repr(i32)]
342pub enum Outcome {
343 Unspecified = 0,
344 Success = 1,
345 Retry = 2,
347 Skip = 3,
349 Revoke = 4,
351 Snooze = 5,
353 LeaseLost = 6,
355 Undecodable = 7,
357 RateLimited = 8,
359}
360impl Outcome {
361 pub fn as_str_name(&self) -> &'static str {
366 match self {
367 Self::Unspecified => "OUTCOME_UNSPECIFIED",
368 Self::Success => "OUTCOME_SUCCESS",
369 Self::Retry => "OUTCOME_RETRY",
370 Self::Skip => "OUTCOME_SKIP",
371 Self::Revoke => "OUTCOME_REVOKE",
372 Self::Snooze => "OUTCOME_SNOOZE",
373 Self::LeaseLost => "OUTCOME_LEASE_LOST",
374 Self::Undecodable => "OUTCOME_UNDECODABLE",
375 Self::RateLimited => "OUTCOME_RATE_LIMITED",
376 }
377 }
378 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
380 match value {
381 "OUTCOME_UNSPECIFIED" => Some(Self::Unspecified),
382 "OUTCOME_SUCCESS" => Some(Self::Success),
383 "OUTCOME_RETRY" => Some(Self::Retry),
384 "OUTCOME_SKIP" => Some(Self::Skip),
385 "OUTCOME_REVOKE" => Some(Self::Revoke),
386 "OUTCOME_SNOOZE" => Some(Self::Snooze),
387 "OUTCOME_LEASE_LOST" => Some(Self::LeaseLost),
388 "OUTCOME_UNDECODABLE" => Some(Self::Undecodable),
389 "OUTCOME_RATE_LIMITED" => Some(Self::RateLimited),
390 _ => None,
391 }
392 }
393}