ringo-task-queue 0.1.0.dev0__py3-none-manylinux_2_17_aarch64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ringo_task_queue/__init__.py +68 -0
- ringo_task_queue/_pb.py +154 -0
- ringo_task_queue/_proto/ringo/v1/queue_pb2.py +133 -0
- ringo_task_queue/_proto/ringo/v1/queue_pb2_grpc.py +574 -0
- ringo_task_queue/_version.py +13 -0
- ringo_task_queue/bin/manifest.json +20 -0
- ringo_task_queue/bin/ringo-task-queue-linux-arm64 +0 -0
- ringo_task_queue/binary.py +253 -0
- ringo_task_queue/client.py +863 -0
- ringo_task_queue/daemon.py +507 -0
- ringo_task_queue/errors.py +152 -0
- ringo_task_queue/models.py +364 -0
- ringo_task_queue/py.typed +0 -0
- ringo_task_queue/worker.py +785 -0
- ringo_task_queue-0.1.0.dev0.dist-info/METADATA +445 -0
- ringo_task_queue-0.1.0.dev0.dist-info/RECORD +18 -0
- ringo_task_queue-0.1.0.dev0.dist-info/WHEEL +4 -0
- ringo_task_queue-0.1.0.dev0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"""Asyncio client for Ringo Task Queue."""
|
|
2
|
+
|
|
3
|
+
from ._version import SDK_VERSION as __version__
|
|
4
|
+
from .client import CompressionOption, LeasedTask, Ringo, RingoClient, TaskQueue
|
|
5
|
+
from .errors import (
|
|
6
|
+
ConflictError,
|
|
7
|
+
DeadlineExceededError,
|
|
8
|
+
DuplicateError,
|
|
9
|
+
IncompatibleVersionError,
|
|
10
|
+
InternalError,
|
|
11
|
+
InvalidArgumentError,
|
|
12
|
+
LeaseLostError,
|
|
13
|
+
NotFoundError,
|
|
14
|
+
PermanentTaskError,
|
|
15
|
+
RetryTaskError,
|
|
16
|
+
RingoError,
|
|
17
|
+
UnavailableError,
|
|
18
|
+
)
|
|
19
|
+
from .models import (
|
|
20
|
+
Attempt,
|
|
21
|
+
BatchResult,
|
|
22
|
+
EnqueueResult,
|
|
23
|
+
LeaseInfo,
|
|
24
|
+
PostgresStorage,
|
|
25
|
+
Progress,
|
|
26
|
+
RetryPolicy,
|
|
27
|
+
RetryStrategy,
|
|
28
|
+
SQLiteStorage,
|
|
29
|
+
Task,
|
|
30
|
+
TaskSpec,
|
|
31
|
+
TaskStatus,
|
|
32
|
+
)
|
|
33
|
+
from .worker import TaskContext, Worker
|
|
34
|
+
|
|
35
|
+
__all__ = [
|
|
36
|
+
"Attempt",
|
|
37
|
+
"BatchResult",
|
|
38
|
+
"ConflictError",
|
|
39
|
+
"CompressionOption",
|
|
40
|
+
"DeadlineExceededError",
|
|
41
|
+
"DuplicateError",
|
|
42
|
+
"EnqueueResult",
|
|
43
|
+
"IncompatibleVersionError",
|
|
44
|
+
"InternalError",
|
|
45
|
+
"InvalidArgumentError",
|
|
46
|
+
"LeaseInfo",
|
|
47
|
+
"LeaseLostError",
|
|
48
|
+
"LeasedTask",
|
|
49
|
+
"NotFoundError",
|
|
50
|
+
"PermanentTaskError",
|
|
51
|
+
"PostgresStorage",
|
|
52
|
+
"Progress",
|
|
53
|
+
"RetryPolicy",
|
|
54
|
+
"RetryStrategy",
|
|
55
|
+
"RetryTaskError",
|
|
56
|
+
"Ringo",
|
|
57
|
+
"RingoClient",
|
|
58
|
+
"RingoError",
|
|
59
|
+
"SQLiteStorage",
|
|
60
|
+
"Task",
|
|
61
|
+
"TaskContext",
|
|
62
|
+
"TaskQueue",
|
|
63
|
+
"TaskSpec",
|
|
64
|
+
"TaskStatus",
|
|
65
|
+
"UnavailableError",
|
|
66
|
+
"Worker",
|
|
67
|
+
"__version__",
|
|
68
|
+
]
|
ringo_task_queue/_pb.py
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"""Conversions between frozen ``ringo.v1`` protobuf messages and Python values.
|
|
2
|
+
|
|
3
|
+
This module is the single place that knows the wire shapes. It handles:
|
|
4
|
+
|
|
5
|
+
- arbitrary JSON payloads (including an explicit ``None``) via
|
|
6
|
+
``google.protobuf.Value``;
|
|
7
|
+
- timezone-aware UTC ``datetime`` <-> ``google.protobuf.Timestamp``;
|
|
8
|
+
- ``datetime.timedelta`` <-> ``google.protobuf.Duration``.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from __future__ import annotations
|
|
12
|
+
|
|
13
|
+
import math
|
|
14
|
+
from datetime import datetime, timedelta, timezone
|
|
15
|
+
from typing import Any
|
|
16
|
+
|
|
17
|
+
from google.protobuf import duration_pb2, struct_pb2, timestamp_pb2
|
|
18
|
+
|
|
19
|
+
from .errors import InvalidArgumentError
|
|
20
|
+
|
|
21
|
+
#: Largest integer exactly representable in a proto ``double``/JSON number.
|
|
22
|
+
_MAX_EXACT_INT = 2**53
|
|
23
|
+
|
|
24
|
+
# ---------------------------------------------------------------------------
|
|
25
|
+
# JSON values
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def py_to_value(obj: Any) -> struct_pb2.Value:
|
|
29
|
+
"""Convert an arbitrary JSON-compatible Python value to a proto Value.
|
|
30
|
+
|
|
31
|
+
``None`` becomes an explicit ``null_value`` (the proto contract requires a
|
|
32
|
+
present payload, and JSON null is legal). Integers beyond the exact range
|
|
33
|
+
of a proto ``double`` and non-finite floats are rejected instead of being
|
|
34
|
+
silently corrupted.
|
|
35
|
+
"""
|
|
36
|
+
msg = struct_pb2.Value()
|
|
37
|
+
_fill_value(msg, obj)
|
|
38
|
+
return msg
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def _fill_value(msg: struct_pb2.Value, obj: Any) -> None:
|
|
42
|
+
if obj is None:
|
|
43
|
+
msg.null_value = struct_pb2.NullValue.NULL_VALUE
|
|
44
|
+
elif isinstance(obj, bool):
|
|
45
|
+
msg.bool_value = obj
|
|
46
|
+
elif isinstance(obj, int):
|
|
47
|
+
if abs(obj) > _MAX_EXACT_INT:
|
|
48
|
+
raise InvalidArgumentError(
|
|
49
|
+
f"payload integer {obj} exceeds the exact JSON number range"
|
|
50
|
+
f" (-2**53..2**53); store it as a string instead"
|
|
51
|
+
)
|
|
52
|
+
msg.number_value = float(obj)
|
|
53
|
+
elif isinstance(obj, float):
|
|
54
|
+
if not math.isfinite(obj):
|
|
55
|
+
raise InvalidArgumentError(
|
|
56
|
+
f"payload contains non-finite float {obj!r}; JSON numbers must be finite"
|
|
57
|
+
)
|
|
58
|
+
msg.number_value = obj
|
|
59
|
+
elif isinstance(obj, str):
|
|
60
|
+
msg.string_value = obj
|
|
61
|
+
elif isinstance(obj, (list, tuple)):
|
|
62
|
+
msg.list_value.SetInParent()
|
|
63
|
+
for item in obj:
|
|
64
|
+
_fill_value(msg.list_value.values.add(), item)
|
|
65
|
+
elif isinstance(obj, dict):
|
|
66
|
+
msg.struct_value.SetInParent()
|
|
67
|
+
for key, item in obj.items():
|
|
68
|
+
if not isinstance(key, str):
|
|
69
|
+
raise InvalidArgumentError(
|
|
70
|
+
f"payload object keys must be strings, got {type(key).__name__}"
|
|
71
|
+
)
|
|
72
|
+
_fill_value(msg.struct_value.fields[key], item)
|
|
73
|
+
else:
|
|
74
|
+
raise InvalidArgumentError(
|
|
75
|
+
f"payload value of type {type(obj).__name__} is not JSON-serializable"
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def value_to_py(msg: struct_pb2.Value) -> Any:
|
|
80
|
+
"""Convert a proto Value back to plain Python JSON values."""
|
|
81
|
+
kind = msg.WhichOneof("kind")
|
|
82
|
+
if kind is None or kind == "null_value":
|
|
83
|
+
return None
|
|
84
|
+
if kind == "bool_value":
|
|
85
|
+
return msg.bool_value
|
|
86
|
+
if kind == "string_value":
|
|
87
|
+
return msg.string_value
|
|
88
|
+
if kind == "number_value":
|
|
89
|
+
number = msg.number_value
|
|
90
|
+
# JSON has one numeric type; normalise integral doubles to int so
|
|
91
|
+
# payloads round-trip through the SDK the way ``json`` users expect.
|
|
92
|
+
if number.is_integer() and abs(number) <= _MAX_EXACT_INT:
|
|
93
|
+
return int(number)
|
|
94
|
+
return number
|
|
95
|
+
if kind == "list_value":
|
|
96
|
+
return [value_to_py(v) for v in msg.list_value.values]
|
|
97
|
+
if kind == "struct_value":
|
|
98
|
+
return {key: value_to_py(v) for key, v in msg.struct_value.fields.items()}
|
|
99
|
+
raise InvalidArgumentError(f"unknown Value kind {kind!r}")
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
# ---------------------------------------------------------------------------
|
|
103
|
+
# Time
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
def dt_to_ts(value: datetime) -> timestamp_pb2.Timestamp:
|
|
107
|
+
if not isinstance(value, datetime):
|
|
108
|
+
raise InvalidArgumentError(f"expected datetime, got {type(value).__name__}")
|
|
109
|
+
if value.tzinfo is None:
|
|
110
|
+
raise InvalidArgumentError(
|
|
111
|
+
"datetime values must be timezone-aware; use datetime.UTC"
|
|
112
|
+
)
|
|
113
|
+
msg = timestamp_pb2.Timestamp()
|
|
114
|
+
try:
|
|
115
|
+
msg.FromDatetime(value)
|
|
116
|
+
# FromDatetime is lenient about seconds; verify round-trip bounds.
|
|
117
|
+
msg.ToDatetime(tzinfo=timezone.utc)
|
|
118
|
+
except (ValueError, OverflowError) as exc:
|
|
119
|
+
raise InvalidArgumentError(f"datetime out of Timestamp range: {exc}") from exc
|
|
120
|
+
return msg
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
def ts_to_dt(msg: timestamp_pb2.Timestamp) -> datetime:
|
|
124
|
+
# ToDatetime returns a tz-aware UTC datetime.
|
|
125
|
+
return msg.ToDatetime(tzinfo=timezone.utc)
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
def td_to_dur(value: timedelta) -> duration_pb2.Duration:
|
|
129
|
+
if not isinstance(value, timedelta):
|
|
130
|
+
raise InvalidArgumentError(f"expected timedelta, got {type(value).__name__}")
|
|
131
|
+
# The daemon/server represents durations as Go time.Duration (int64
|
|
132
|
+
# nanoseconds, about +/-292 years); reject anything outside that range so
|
|
133
|
+
# values can never silently wrap.
|
|
134
|
+
total_ns = (
|
|
135
|
+
(value.days * 86_400 + value.seconds) * 1_000_000 + value.microseconds
|
|
136
|
+
) * 1_000
|
|
137
|
+
if abs(total_ns) > 2**63 - 1:
|
|
138
|
+
raise InvalidArgumentError(
|
|
139
|
+
f"timedelta {value} is outside the representable duration range"
|
|
140
|
+
" (Go time.Duration, about +/-292 years)"
|
|
141
|
+
)
|
|
142
|
+
msg = duration_pb2.Duration()
|
|
143
|
+
try:
|
|
144
|
+
msg.FromNanoseconds(total_ns)
|
|
145
|
+
msg.ToTimedelta()
|
|
146
|
+
except (ValueError, OverflowError) as exc:
|
|
147
|
+
raise InvalidArgumentError(f"timedelta out of Duration range: {exc}") from exc
|
|
148
|
+
return msg
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
def dur_to_td(msg: duration_pb2.Duration | None) -> timedelta | None:
|
|
152
|
+
if msg is None:
|
|
153
|
+
return None
|
|
154
|
+
return msg.ToTimedelta()
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# Code generated by protoc (grpc_tools). DO NOT EDIT.
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
4
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
5
|
+
# source: ringo_task_queue/_proto/ringo/v1/queue.proto
|
|
6
|
+
# Protobuf Python Version: 5.29.0
|
|
7
|
+
"""Generated protocol buffer code."""
|
|
8
|
+
from google.protobuf import descriptor as _descriptor
|
|
9
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
10
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
11
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
12
|
+
from google.protobuf.internal import builder as _builder
|
|
13
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
14
|
+
_runtime_version.Domain.PUBLIC,
|
|
15
|
+
5,
|
|
16
|
+
29,
|
|
17
|
+
0,
|
|
18
|
+
'',
|
|
19
|
+
'ringo_task_queue/_proto/ringo/v1/queue.proto'
|
|
20
|
+
)
|
|
21
|
+
# @@protoc_insertion_point(imports)
|
|
22
|
+
|
|
23
|
+
_sym_db = _symbol_database.Default()
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2
|
|
27
|
+
from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2
|
|
28
|
+
from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n,ringo_task_queue/_proto/ringo/v1/queue.proto\x12\x08ringo.v1\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"i\n\x10NegotiateRequest\x12\x10\n\x08sdk_name\x18\x01 \x01(\t\x12\x13\n\x0bsdk_version\x18\x02 \x01(\t\x12\x16\n\x0eprotocol_major\x18\x03 \x01(\r\x12\x16\n\x0eprotocol_minor\x18\x04 \x01(\r\"\x88\x01\n\x11NegotiateResponse\x12\x16\n\x0eserver_version\x18\x01 \x01(\t\x12\x16\n\x0eprotocol_major\x18\x02 \x01(\r\x12\x16\n\x0eprotocol_minor\x18\x03 \x01(\r\x12\x14\n\x0c\x63\x61pabilities\x18\x04 \x03(\t\x12\x15\n\rsession_token\x18\x05 \x01(\t\"W\n\x0eRequestContext\x12\x16\n\x0eprotocol_major\x18\x01 \x01(\r\x12\x16\n\x0eprotocol_minor\x18\x02 \x01(\r\x12\x15\n\rsession_token\x18\x03 \x01(\t\"\xbd\x01\n\x0b\x45rrorDetail\x12!\n\x04\x63ode\x18\x01 \x01(\x0e\x32\x13.ringo.v1.ErrorCode\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x12\n\nrequest_id\x18\x03 \x01(\t\x12\x35\n\x08metadata\x18\x04 \x03(\x0b\x32#.ringo.v1.ErrorDetail.MetadataEntry\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xed\x01\n\x0bRetryPolicy\x12\x14\n\x0cmax_attempts\x18\x01 \x01(\r\x12)\n\x08strategy\x18\x02 \x01(\x0e\x32\x17.ringo.v1.RetryStrategy\x12\x30\n\rinitial_delay\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12,\n\tmax_delay\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x12\n\nmultiplier\x18\x05 \x01(\x01\x12\x0e\n\x06jitter\x18\x06 \x01(\x01\x12\x19\n\x11\x64\x65\x63rease_priority\x18\x07 \x01(\x08\"\xc6\x01\n\x08TaskSpec\x12\x12\n\nunique_key\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\'\n\x07payload\x18\x03 \x01(\x0b\x32\x16.google.protobuf.Value\x12\x10\n\x08priority\x18\x04 \x01(\x05\x12+\n\x0cretry_policy\x18\x05 \x01(\x0b\x32\x15.ringo.v1.RetryPolicy\x12\x30\n\x0c\x61vailable_at\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xb8\x04\n\x04Task\x12\n\n\x02id\x18\x01 \x01(\t\x12\r\n\x05queue\x18\x02 \x01(\t\x12\x12\n\nunique_key\x18\x03 \x01(\t\x12\x0c\n\x04type\x18\x04 \x01(\t\x12\'\n\x07payload\x18\x05 \x01(\x0b\x32\x16.google.protobuf.Value\x12\x10\n\x08priority\x18\x06 \x01(\x05\x12$\n\x06status\x18\x07 \x01(\x0e\x32\x14.ringo.v1.TaskStatus\x12\x0f\n\x07\x61ttempt\x18\x08 \x01(\r\x12\x14\n\x0cmax_attempts\x18\t \x01(\r\x12\x30\n\x0c\x61vailable_at\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12.\n\ncreated_at\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12.\n\nupdated_at\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x30\n\x0c\x63ompleted_at\x18\r \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x12\n\nlast_error\x18\x0e \x01(\t\x12\x1c\n\x14last_error_truncated\x18\x0f \x01(\x08\x12#\n\x08\x61ttempts\x18\x10 \x03(\x0b\x32\x11.ringo.v1.Attempt\x12$\n\x08progress\x18\x11 \x01(\x0b\x32\x12.ringo.v1.Progress\x12*\n\rcurrent_lease\x18\x12 \x01(\x0b\x32\x13.ringo.v1.LeaseInfo\"\xc6\x01\n\x07\x41ttempt\x12\x0e\n\x06number\x18\x01 \x01(\r\x12\x11\n\tworker_id\x18\x02 \x01(\t\x12.\n\nstarted_at\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x66inished_at\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0f\n\x07outcome\x18\x05 \x01(\t\x12\r\n\x05\x65rror\x18\x06 \x01(\t\x12\x17\n\x0f\x65rror_truncated\x18\x07 \x01(\x08\"k\n\x08Progress\x12\x0f\n\x07\x63urrent\x18\x01 \x01(\x01\x12\r\n\x05total\x18\x02 \x01(\x01\x12\x0f\n\x07message\x18\x03 \x01(\t\x12.\n\nupdated_at\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"Z\n\tLeaseInfo\x12\x0f\n\x07\x61ttempt\x18\x01 \x01(\r\x12\x11\n\tworker_id\x18\x02 \x01(\t\x12)\n\x05until\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"|\n\x05Lease\x12\x0f\n\x07task_id\x18\x01 \x01(\t\x12\x0f\n\x07\x61ttempt\x18\x02 \x01(\r\x12\x13\n\x0blease_token\x18\x03 \x01(\t\x12\x11\n\tworker_id\x18\x04 \x01(\t\x12)\n\x05until\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"J\n\nLeasedTask\x12\x1c\n\x04task\x18\x01 \x01(\x0b\x32\x0e.ringo.v1.Task\x12\x1e\n\x05lease\x18\x02 \x01(\x0b\x32\x0f.ringo.v1.Lease\"l\n\x0e\x45nqueueRequest\x12\r\n\x05queue\x18\x01 \x01(\t\x12 \n\x04task\x18\x02 \x01(\x0b\x32\x12.ringo.v1.TaskSpec\x12)\n\x07\x63ontext\x18\x0f \x01(\x0b\x32\x18.ringo.v1.RequestContext\"O\n\rEnqueueResult\x12\x0f\n\x07task_id\x18\x01 \x01(\t\x12\x0f\n\x07\x63reated\x18\x02 \x01(\x08\x12\x1c\n\x04task\x18\x03 \x01(\x0b\x32\x0e.ringo.v1.Task\":\n\x0f\x45nqueueResponse\x12\'\n\x06result\x18\x01 \x01(\x0b\x32\x17.ringo.v1.EnqueueResult\"q\n\x12\x45nqueueManyRequest\x12\r\n\x05queue\x18\x01 \x01(\t\x12!\n\x05tasks\x18\x02 \x03(\x0b\x32\x12.ringo.v1.TaskSpec\x12)\n\x07\x63ontext\x18\x0f \x01(\x0b\x32\x18.ringo.v1.RequestContext\"o\n\x13\x45nqueueManyResponse\x12(\n\x07results\x18\x01 \x03(\x0b\x32\x17.ringo.v1.EnqueueResult\x12\x15\n\rcreated_count\x18\x02 \x01(\r\x12\x17\n\x0f\x64uplicate_count\x18\x03 \x01(\r\"z\n\x0eGetTaskRequest\x12\r\n\x05queue\x18\x01 \x01(\t\x12\x11\n\x07task_id\x18\x02 \x01(\tH\x00\x12\x14\n\nunique_key\x18\x03 \x01(\tH\x00\x12)\n\x07\x63ontext\x18\x0f \x01(\x0b\x32\x18.ringo.v1.RequestContextB\x05\n\x03key\"/\n\x0fGetTaskResponse\x12\x1c\n\x04task\x18\x01 \x01(\x0b\x32\x0e.ringo.v1.Task\"|\n\x10RetryTaskRequest\x12\r\n\x05queue\x18\x01 \x01(\t\x12\x11\n\x07task_id\x18\x02 \x01(\tH\x00\x12\x14\n\nunique_key\x18\x03 \x01(\tH\x00\x12)\n\x07\x63ontext\x18\x0f \x01(\x0b\x32\x18.ringo.v1.RequestContextB\x05\n\x03key\"1\n\x11RetryTaskResponse\x12\x1c\n\x04task\x18\x01 \x01(\x0b\x32\x0e.ringo.v1.Task\"\xe2\x01\n\x0c\x43laimRequest\x12\r\n\x05queue\x18\x01 \x01(\t\x12\x11\n\tworker_id\x18\x02 \x01(\t\x12\x12\n\ntask_types\x18\x03 \x03(\t\x12\r\n\x05limit\x18\x04 \x01(\r\x12/\n\x0cwait_timeout\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x31\n\x0elease_duration\x18\x06 \x01(\x0b\x32\x19.google.protobuf.Duration\x12)\n\x07\x63ontext\x18\x0f \x01(\x0b\x32\x18.ringo.v1.RequestContext\"4\n\rClaimResponse\x12#\n\x05tasks\x18\x01 \x03(\x0b\x32\x14.ringo.v1.LeasedTask\"A\n\x08LeaseRef\x12\x0f\n\x07task_id\x18\x01 \x01(\t\x12\x0f\n\x07\x61ttempt\x18\x02 \x01(\r\x12\x13\n\x0blease_token\x18\x03 \x01(\t\"Z\n\nAckRequest\x12!\n\x05lease\x18\x01 \x01(\x0b\x32\x12.ringo.v1.LeaseRef\x12)\n\x07\x63ontext\x18\x0f \x01(\x0b\x32\x18.ringo.v1.RequestContext\"\r\n\x0b\x41\x63kResponse\"\xa3\x01\n\x0bNackRequest\x12!\n\x05lease\x18\x01 \x01(\x0b\x32\x12.ringo.v1.LeaseRef\x12\r\n\x05\x65rror\x18\x02 \x01(\t\x12\x37\n\x14retry_delay_override\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12)\n\x07\x63ontext\x18\x0f \x01(\x0b\x32\x18.ringo.v1.RequestContext\",\n\x0cNackResponse\x12\x1c\n\x04task\x18\x01 \x01(\x0b\x32\x0e.ringo.v1.Task\"l\n\rRejectRequest\x12!\n\x05lease\x18\x01 \x01(\x0b\x32\x12.ringo.v1.LeaseRef\x12\r\n\x05\x65rror\x18\x02 \x01(\t\x12)\n\x07\x63ontext\x18\x0f \x01(\x0b\x32\x18.ringo.v1.RequestContext\".\n\x0eRejectResponse\x12\x1c\n\x04task\x18\x01 \x01(\x0b\x32\x0e.ringo.v1.Task\"\x90\x01\n\x12\x45xtendLeaseRequest\x12!\n\x05lease\x18\x01 \x01(\x0b\x32\x12.ringo.v1.LeaseRef\x12,\n\textension\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12)\n\x07\x63ontext\x18\x0f \x01(\x0b\x32\x18.ringo.v1.RequestContext\"5\n\x13\x45xtendLeaseResponse\x12\x1e\n\x05lease\x18\x01 \x01(\x0b\x32\x0f.ringo.v1.Lease\"\x96\x01\n\x15ReportProgressRequest\x12!\n\x05lease\x18\x01 \x01(\x0b\x32\x12.ringo.v1.LeaseRef\x12\x0f\n\x07\x63urrent\x18\x02 \x01(\x01\x12\r\n\x05total\x18\x03 \x01(\x01\x12\x0f\n\x07message\x18\x04 \x01(\t\x12)\n\x07\x63ontext\x18\x0f \x01(\x0b\x32\x18.ringo.v1.RequestContext\"\x18\n\x16ReportProgressResponse\"\xc1\x01\n\x12WorkerRegistration\x12\r\n\x05queue\x18\x01 \x01(\t\x12\x11\n\tworker_id\x18\x02 \x01(\t\x12\x12\n\ntask_types\x18\x03 \x03(\t\x12\x17\n\x0fmax_concurrency\x18\x04 \x01(\r\x12\x31\n\x0elease_duration\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12)\n\x07\x63ontext\x18\x0f \x01(\x0b\x32\x18.ringo.v1.RequestContext\"!\n\x0c\x43reditUpdate\x12\x11\n\tavailable\x18\x01 \x01(\r\"\x1c\n\x0bWorkerDrain\x12\r\n\x05\x62\x65gin\x18\x01 \x01(\x08\"q\n\x10WorkerRegistered\x12\x11\n\tworker_id\x18\x01 \x01(\t\x12\x17\n\x0fmax_concurrency\x18\x02 \x01(\r\x12\x31\n\x0elease_duration\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\"\x8f\x03\n\x0bWorkRequest\x12\x12\n\nrequest_id\x18\x01 \x01(\x04\x12\x30\n\x08register\x18\x02 \x01(\x0b\x32\x1c.ringo.v1.WorkerRegistrationH\x00\x12(\n\x06\x63redit\x18\x03 \x01(\x0b\x32\x16.ringo.v1.CreditUpdateH\x00\x12#\n\x03\x61\x63k\x18\x04 \x01(\x0b\x32\x14.ringo.v1.AckRequestH\x00\x12%\n\x04nack\x18\x05 \x01(\x0b\x32\x15.ringo.v1.NackRequestH\x00\x12)\n\x06reject\x18\x06 \x01(\x0b\x32\x17.ringo.v1.RejectRequestH\x00\x12\x34\n\x0c\x65xtend_lease\x18\x07 \x01(\x0b\x32\x1c.ringo.v1.ExtendLeaseRequestH\x00\x12\x33\n\x08progress\x18\x08 \x01(\x0b\x32\x1f.ringo.v1.ReportProgressRequestH\x00\x12&\n\x05\x64rain\x18\t \x01(\x0b\x32\x15.ringo.v1.WorkerDrainH\x00\x42\x06\n\x04\x62ody\"F\n\nWorkResult\x12\x12\n\nrequest_id\x18\x01 \x01(\x04\x12$\n\x05\x65rror\x18\x02 \x01(\x0b\x32\x15.ringo.v1.ErrorDetail\"\xc7\x01\n\x0cWorkResponse\x12$\n\x04task\x18\x01 \x01(\x0b\x32\x14.ringo.v1.LeasedTaskH\x00\x12&\n\x06result\x18\x02 \x01(\x0b\x32\x14.ringo.v1.WorkResultH\x00\x12/\n\theartbeat\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x12\x30\n\nregistered\x18\x04 \x01(\x0b\x32\x1a.ringo.v1.WorkerRegisteredH\x00\x42\x06\n\x04\x62ody*\xbf\x01\n\nTaskStatus\x12\x1b\n\x17TASK_STATUS_UNSPECIFIED\x10\x00\x12\x19\n\x15TASK_STATUS_SCHEDULED\x10\x01\x12\x15\n\x11TASK_STATUS_READY\x10\x02\x12\x16\n\x12TASK_STATUS_LEASED\x10\x03\x12\x19\n\x15TASK_STATUS_SUCCEEDED\x10\x04\x12\x14\n\x10TASK_STATUS_DEAD\x10\x05\x12\x19\n\x15TASK_STATUS_CANCELLED\x10\x06*i\n\rRetryStrategy\x12\x1e\n\x1aRETRY_STRATEGY_UNSPECIFIED\x10\x00\x12\x18\n\x14RETRY_STRATEGY_FIXED\x10\x01\x12\x1e\n\x1aRETRY_STRATEGY_EXPONENTIAL\x10\x02*\xac\x02\n\tErrorCode\x12\x1a\n\x16\x45RROR_CODE_UNSPECIFIED\x10\x00\x12\x1f\n\x1b\x45RROR_CODE_INVALID_ARGUMENT\x10\x01\x12\x18\n\x14\x45RROR_CODE_DUPLICATE\x10\x02\x12\x18\n\x14\x45RROR_CODE_NOT_FOUND\x10\x03\x12\x17\n\x13\x45RROR_CODE_CONFLICT\x10\x04\x12\x19\n\x15\x45RROR_CODE_LEASE_LOST\x10\x05\x12\x1a\n\x16\x45RROR_CODE_UNAVAILABLE\x10\x06\x12 \n\x1c\x45RROR_CODE_DEADLINE_EXCEEDED\x10\x07\x12#\n\x1f\x45RROR_CODE_INCOMPATIBLE_VERSION\x10\x08\x12\x17\n\x13\x45RROR_CODE_INTERNAL\x10\t2\xa4\x06\n\x0cQueueService\x12\x44\n\tNegotiate\x12\x1a.ringo.v1.NegotiateRequest\x1a\x1b.ringo.v1.NegotiateResponse\x12>\n\x07\x45nqueue\x12\x18.ringo.v1.EnqueueRequest\x1a\x19.ringo.v1.EnqueueResponse\x12J\n\x0b\x45nqueueMany\x12\x1c.ringo.v1.EnqueueManyRequest\x1a\x1d.ringo.v1.EnqueueManyResponse\x12>\n\x07GetTask\x12\x18.ringo.v1.GetTaskRequest\x1a\x19.ringo.v1.GetTaskResponse\x12\x44\n\tRetryTask\x12\x1a.ringo.v1.RetryTaskRequest\x1a\x1b.ringo.v1.RetryTaskResponse\x12\x38\n\x05\x43laim\x12\x16.ringo.v1.ClaimRequest\x1a\x17.ringo.v1.ClaimResponse\x12\x32\n\x03\x41\x63k\x12\x14.ringo.v1.AckRequest\x1a\x15.ringo.v1.AckResponse\x12\x35\n\x04Nack\x12\x15.ringo.v1.NackRequest\x1a\x16.ringo.v1.NackResponse\x12;\n\x06Reject\x12\x17.ringo.v1.RejectRequest\x1a\x18.ringo.v1.RejectResponse\x12J\n\x0b\x45xtendLease\x12\x1c.ringo.v1.ExtendLeaseRequest\x1a\x1d.ringo.v1.ExtendLeaseResponse\x12S\n\x0eReportProgress\x12\x1f.ringo.v1.ReportProgressRequest\x1a .ringo.v1.ReportProgressResponse\x12\x39\n\x04Work\x12\x15.ringo.v1.WorkRequest\x1a\x16.ringo.v1.WorkResponse(\x01\x30\x01\x42l\n\x16\x64\x65v.ringo.taskqueue.v1B\nQueueProtoP\x01ZDgithub.com/ringo-task-queue/ringo-task-queue/gen/go/ringo/v1;ringov1b\x06proto3')
|
|
32
|
+
|
|
33
|
+
_globals = globals()
|
|
34
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
35
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'ringo_task_queue._proto.ringo.v1.queue_pb2', _globals)
|
|
36
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
37
|
+
_globals['DESCRIPTOR']._loaded_options = None
|
|
38
|
+
_globals['DESCRIPTOR']._serialized_options = b'\n\026dev.ringo.taskqueue.v1B\nQueueProtoP\001ZDgithub.com/ringo-task-queue/ringo-task-queue/gen/go/ringo/v1;ringov1'
|
|
39
|
+
_globals['_ERRORDETAIL_METADATAENTRY']._loaded_options = None
|
|
40
|
+
_globals['_ERRORDETAIL_METADATAENTRY']._serialized_options = b'8\001'
|
|
41
|
+
_globals['_TASKSTATUS']._serialized_start=5386
|
|
42
|
+
_globals['_TASKSTATUS']._serialized_end=5577
|
|
43
|
+
_globals['_RETRYSTRATEGY']._serialized_start=5579
|
|
44
|
+
_globals['_RETRYSTRATEGY']._serialized_end=5684
|
|
45
|
+
_globals['_ERRORCODE']._serialized_start=5687
|
|
46
|
+
_globals['_ERRORCODE']._serialized_end=5987
|
|
47
|
+
_globals['_NEGOTIATEREQUEST']._serialized_start=153
|
|
48
|
+
_globals['_NEGOTIATEREQUEST']._serialized_end=258
|
|
49
|
+
_globals['_NEGOTIATERESPONSE']._serialized_start=261
|
|
50
|
+
_globals['_NEGOTIATERESPONSE']._serialized_end=397
|
|
51
|
+
_globals['_REQUESTCONTEXT']._serialized_start=399
|
|
52
|
+
_globals['_REQUESTCONTEXT']._serialized_end=486
|
|
53
|
+
_globals['_ERRORDETAIL']._serialized_start=489
|
|
54
|
+
_globals['_ERRORDETAIL']._serialized_end=678
|
|
55
|
+
_globals['_ERRORDETAIL_METADATAENTRY']._serialized_start=631
|
|
56
|
+
_globals['_ERRORDETAIL_METADATAENTRY']._serialized_end=678
|
|
57
|
+
_globals['_RETRYPOLICY']._serialized_start=681
|
|
58
|
+
_globals['_RETRYPOLICY']._serialized_end=918
|
|
59
|
+
_globals['_TASKSPEC']._serialized_start=921
|
|
60
|
+
_globals['_TASKSPEC']._serialized_end=1119
|
|
61
|
+
_globals['_TASK']._serialized_start=1122
|
|
62
|
+
_globals['_TASK']._serialized_end=1690
|
|
63
|
+
_globals['_ATTEMPT']._serialized_start=1693
|
|
64
|
+
_globals['_ATTEMPT']._serialized_end=1891
|
|
65
|
+
_globals['_PROGRESS']._serialized_start=1893
|
|
66
|
+
_globals['_PROGRESS']._serialized_end=2000
|
|
67
|
+
_globals['_LEASEINFO']._serialized_start=2002
|
|
68
|
+
_globals['_LEASEINFO']._serialized_end=2092
|
|
69
|
+
_globals['_LEASE']._serialized_start=2094
|
|
70
|
+
_globals['_LEASE']._serialized_end=2218
|
|
71
|
+
_globals['_LEASEDTASK']._serialized_start=2220
|
|
72
|
+
_globals['_LEASEDTASK']._serialized_end=2294
|
|
73
|
+
_globals['_ENQUEUEREQUEST']._serialized_start=2296
|
|
74
|
+
_globals['_ENQUEUEREQUEST']._serialized_end=2404
|
|
75
|
+
_globals['_ENQUEUERESULT']._serialized_start=2406
|
|
76
|
+
_globals['_ENQUEUERESULT']._serialized_end=2485
|
|
77
|
+
_globals['_ENQUEUERESPONSE']._serialized_start=2487
|
|
78
|
+
_globals['_ENQUEUERESPONSE']._serialized_end=2545
|
|
79
|
+
_globals['_ENQUEUEMANYREQUEST']._serialized_start=2547
|
|
80
|
+
_globals['_ENQUEUEMANYREQUEST']._serialized_end=2660
|
|
81
|
+
_globals['_ENQUEUEMANYRESPONSE']._serialized_start=2662
|
|
82
|
+
_globals['_ENQUEUEMANYRESPONSE']._serialized_end=2773
|
|
83
|
+
_globals['_GETTASKREQUEST']._serialized_start=2775
|
|
84
|
+
_globals['_GETTASKREQUEST']._serialized_end=2897
|
|
85
|
+
_globals['_GETTASKRESPONSE']._serialized_start=2899
|
|
86
|
+
_globals['_GETTASKRESPONSE']._serialized_end=2946
|
|
87
|
+
_globals['_RETRYTASKREQUEST']._serialized_start=2948
|
|
88
|
+
_globals['_RETRYTASKREQUEST']._serialized_end=3072
|
|
89
|
+
_globals['_RETRYTASKRESPONSE']._serialized_start=3074
|
|
90
|
+
_globals['_RETRYTASKRESPONSE']._serialized_end=3123
|
|
91
|
+
_globals['_CLAIMREQUEST']._serialized_start=3126
|
|
92
|
+
_globals['_CLAIMREQUEST']._serialized_end=3352
|
|
93
|
+
_globals['_CLAIMRESPONSE']._serialized_start=3354
|
|
94
|
+
_globals['_CLAIMRESPONSE']._serialized_end=3406
|
|
95
|
+
_globals['_LEASEREF']._serialized_start=3408
|
|
96
|
+
_globals['_LEASEREF']._serialized_end=3473
|
|
97
|
+
_globals['_ACKREQUEST']._serialized_start=3475
|
|
98
|
+
_globals['_ACKREQUEST']._serialized_end=3565
|
|
99
|
+
_globals['_ACKRESPONSE']._serialized_start=3567
|
|
100
|
+
_globals['_ACKRESPONSE']._serialized_end=3580
|
|
101
|
+
_globals['_NACKREQUEST']._serialized_start=3583
|
|
102
|
+
_globals['_NACKREQUEST']._serialized_end=3746
|
|
103
|
+
_globals['_NACKRESPONSE']._serialized_start=3748
|
|
104
|
+
_globals['_NACKRESPONSE']._serialized_end=3792
|
|
105
|
+
_globals['_REJECTREQUEST']._serialized_start=3794
|
|
106
|
+
_globals['_REJECTREQUEST']._serialized_end=3902
|
|
107
|
+
_globals['_REJECTRESPONSE']._serialized_start=3904
|
|
108
|
+
_globals['_REJECTRESPONSE']._serialized_end=3950
|
|
109
|
+
_globals['_EXTENDLEASEREQUEST']._serialized_start=3953
|
|
110
|
+
_globals['_EXTENDLEASEREQUEST']._serialized_end=4097
|
|
111
|
+
_globals['_EXTENDLEASERESPONSE']._serialized_start=4099
|
|
112
|
+
_globals['_EXTENDLEASERESPONSE']._serialized_end=4152
|
|
113
|
+
_globals['_REPORTPROGRESSREQUEST']._serialized_start=4155
|
|
114
|
+
_globals['_REPORTPROGRESSREQUEST']._serialized_end=4305
|
|
115
|
+
_globals['_REPORTPROGRESSRESPONSE']._serialized_start=4307
|
|
116
|
+
_globals['_REPORTPROGRESSRESPONSE']._serialized_end=4331
|
|
117
|
+
_globals['_WORKERREGISTRATION']._serialized_start=4334
|
|
118
|
+
_globals['_WORKERREGISTRATION']._serialized_end=4527
|
|
119
|
+
_globals['_CREDITUPDATE']._serialized_start=4529
|
|
120
|
+
_globals['_CREDITUPDATE']._serialized_end=4562
|
|
121
|
+
_globals['_WORKERDRAIN']._serialized_start=4564
|
|
122
|
+
_globals['_WORKERDRAIN']._serialized_end=4592
|
|
123
|
+
_globals['_WORKERREGISTERED']._serialized_start=4594
|
|
124
|
+
_globals['_WORKERREGISTERED']._serialized_end=4707
|
|
125
|
+
_globals['_WORKREQUEST']._serialized_start=4710
|
|
126
|
+
_globals['_WORKREQUEST']._serialized_end=5109
|
|
127
|
+
_globals['_WORKRESULT']._serialized_start=5111
|
|
128
|
+
_globals['_WORKRESULT']._serialized_end=5181
|
|
129
|
+
_globals['_WORKRESPONSE']._serialized_start=5184
|
|
130
|
+
_globals['_WORKRESPONSE']._serialized_end=5383
|
|
131
|
+
_globals['_QUEUESERVICE']._serialized_start=5990
|
|
132
|
+
_globals['_QUEUESERVICE']._serialized_end=6794
|
|
133
|
+
# @@protoc_insertion_point(module_scope)
|