tasq-client-python 0.1.11__tar.gz → 0.1.12__tar.gz
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.
- {tasq-client-python-0.1.11 → tasq-client-python-0.1.12}/PKG-INFO +1 -1
- {tasq-client-python-0.1.11 → tasq-client-python-0.1.12}/setup.py +1 -1
- {tasq-client-python-0.1.11 → tasq-client-python-0.1.12}/tasq_client/client.py +15 -9
- {tasq-client-python-0.1.11 → tasq-client-python-0.1.12}/tasq_client_python.egg-info/PKG-INFO +1 -1
- {tasq-client-python-0.1.11 → tasq-client-python-0.1.12}/README.md +0 -0
- {tasq-client-python-0.1.11 → tasq-client-python-0.1.12}/setup.cfg +0 -0
- {tasq-client-python-0.1.11 → tasq-client-python-0.1.12}/tasq_client/__init__.py +0 -0
- {tasq-client-python-0.1.11 → tasq-client-python-0.1.12}/tasq_client/check_type.py +0 -0
- {tasq-client-python-0.1.11 → tasq-client-python-0.1.12}/tasq_client/check_type_test.py +0 -0
- {tasq-client-python-0.1.11 → tasq-client-python-0.1.12}/tasq_client_python.egg-info/SOURCES.txt +0 -0
- {tasq-client-python-0.1.11 → tasq-client-python-0.1.12}/tasq_client_python.egg-info/dependency_links.txt +0 -0
- {tasq-client-python-0.1.11 → tasq-client-python-0.1.12}/tasq_client_python.egg-info/requires.txt +0 -0
- {tasq-client-python-0.1.11 → tasq-client-python-0.1.12}/tasq_client_python.egg-info/top_level.txt +0 -0
|
@@ -30,6 +30,10 @@ class QueueCounts:
|
|
|
30
30
|
expired: int
|
|
31
31
|
completed: int
|
|
32
32
|
|
|
33
|
+
# Won't be set if a time window wasn't specified in the request, or if the
|
|
34
|
+
# server is old enough to not support rate estimation.
|
|
35
|
+
rate: Optional[float] = None
|
|
36
|
+
|
|
33
37
|
|
|
34
38
|
class TasqClient:
|
|
35
39
|
"""
|
|
@@ -193,16 +197,17 @@ class TasqClient:
|
|
|
193
197
|
yield None
|
|
194
198
|
return
|
|
195
199
|
|
|
196
|
-
def counts(self) -> QueueCounts:
|
|
200
|
+
def counts(self, rate_window: int = 0) -> QueueCounts:
|
|
197
201
|
"""Get the number of tasks in each state within the queue."""
|
|
198
202
|
data = self._get(
|
|
199
|
-
"/counts",
|
|
200
|
-
|
|
201
|
-
pending
|
|
202
|
-
running
|
|
203
|
-
expired
|
|
204
|
-
completed
|
|
205
|
-
|
|
203
|
+
f"/counts?window={rate_window}",
|
|
204
|
+
{
|
|
205
|
+
"pending": int,
|
|
206
|
+
"running": int,
|
|
207
|
+
"expired": int,
|
|
208
|
+
"completed": int,
|
|
209
|
+
OptionalKey("minute_rate"): float,
|
|
210
|
+
},
|
|
206
211
|
)
|
|
207
212
|
return QueueCounts(**data)
|
|
208
213
|
|
|
@@ -262,7 +267,8 @@ class TasqClient:
|
|
|
262
267
|
)
|
|
263
268
|
|
|
264
269
|
def _url_for_path(self, path: str, supports_timeout: bool) -> str:
|
|
265
|
-
|
|
270
|
+
separator = "?" if "?" not in path else "&"
|
|
271
|
+
result = self.base_url + path + separator + "context=" + urllib.parse.quote(self.context)
|
|
266
272
|
if supports_timeout and self.task_timeout is not None:
|
|
267
273
|
result += "&timeout=" + urllib.parse.quote(f"{self.task_timeout:f}")
|
|
268
274
|
return result
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tasq-client-python-0.1.11 → tasq-client-python-0.1.12}/tasq_client_python.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{tasq-client-python-0.1.11 → tasq-client-python-0.1.12}/tasq_client_python.egg-info/requires.txt
RENAMED
|
File without changes
|
{tasq-client-python-0.1.11 → tasq-client-python-0.1.12}/tasq_client_python.egg-info/top_level.txt
RENAMED
|
File without changes
|