tasq-client-python 0.1.14__tar.gz → 0.1.16__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.
@@ -0,0 +1,10 @@
1
+ Metadata-Version: 2.1
2
+ Name: tasq-client-python
3
+ Version: 0.1.16
4
+ Summary: UNKNOWN
5
+ Home-page: UNKNOWN
6
+ License: UNKNOWN
7
+ Platform: UNKNOWN
8
+
9
+ UNKNOWN
10
+
@@ -4,5 +4,5 @@ setup(
4
4
  name="tasq-client-python",
5
5
  packages=["tasq_client"],
6
6
  install_requires=["requests"],
7
- version="0.1.14",
7
+ version="0.1.16",
8
8
  )
@@ -35,6 +35,8 @@ class QueueCounts:
35
35
  # server is old enough to not support rate estimation.
36
36
  rate: Optional[float] = None
37
37
 
38
+ modtime: Optional[int] = None
39
+
38
40
 
39
41
  class TasqClient:
40
42
  """
@@ -255,7 +257,7 @@ class TasqClient:
255
257
  def counts(self, rate_window: int = 0) -> QueueCounts:
256
258
  """Get the number of tasks in each state within the queue."""
257
259
  data = self._get(
258
- f"/counts?window={rate_window}",
260
+ f"/counts?window={rate_window}&includeModtime=1",
259
261
  {
260
262
  "pending": int,
261
263
  "running": int,
@@ -266,6 +268,14 @@ class TasqClient:
266
268
  )
267
269
  return QueueCounts(**data)
268
270
 
271
+ def clear(self):
272
+ """Deletes the queue and all tasks in it."""
273
+ result = self._post_form("/task/clear", dict())
274
+ if result is True:
275
+ return True
276
+ else:
277
+ raise TasqMisbehavingServerError("failed to clear queue")
278
+
269
279
  def __getstate__(
270
280
  self,
271
281
  ):
@@ -0,0 +1,10 @@
1
+ Metadata-Version: 2.1
2
+ Name: tasq-client-python
3
+ Version: 0.1.16
4
+ Summary: UNKNOWN
5
+ Home-page: UNKNOWN
6
+ License: UNKNOWN
7
+ Platform: UNKNOWN
8
+
9
+ UNKNOWN
10
+
@@ -1,3 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: tasq-client-python
3
- Version: 0.1.14
@@ -1,3 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: tasq-client-python
3
- Version: 0.1.14