localqueue 0.3.3__tar.gz → 0.3.4__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.
- {localqueue-0.3.3 → localqueue-0.3.4}/CHANGELOG.md +5 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/PKG-INFO +1 -1
- {localqueue-0.3.3 → localqueue-0.3.4}/docs/release.md +1 -1
- {localqueue-0.3.3 → localqueue-0.3.4}/localqueue/services/queue_worker.py +2 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/pyproject.toml +1 -1
- {localqueue-0.3.3 → localqueue-0.3.4}/tests/test_cli.py +50 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/uv.lock +1 -1
- {localqueue-0.3.3 → localqueue-0.3.4}/.gitignore +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/LICENSE +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/README.md +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/docs/api.md +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/docs/compare.md +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/docs/index.md +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/docs/operational-maturity.md +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/docs/queues.md +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/docs/retries.md +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/docs/stability.md +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/examples/email_worker.py +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/examples/enqueue_email.py +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/examples/process_webhook.sh +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/examples/retry_demo.py +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/examples/sqlite_concurrency_benchmark.py +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/examples/sqlite_process_harness.py +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/localqueue/__init__.py +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/localqueue/cli.py +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/localqueue/cli_commands.py +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/localqueue/cli_support.py +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/localqueue/cli_worker_commands.py +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/localqueue/failure.py +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/localqueue/paths.py +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/localqueue/queue.py +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/localqueue/retry/__init__.py +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/localqueue/retry/stores/__init__.py +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/localqueue/retry/stores/_shared.py +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/localqueue/retry/stores/base.py +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/localqueue/retry/stores/lmdb.py +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/localqueue/retry/stores/memory.py +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/localqueue/retry/stores/sqlite.py +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/localqueue/retry/tenacity.py +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/localqueue/services/__init__.py +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/localqueue/stores/__init__.py +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/localqueue/stores/_shared.py +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/localqueue/stores/base.py +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/localqueue/stores/lmdb.py +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/localqueue/stores/memory.py +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/localqueue/stores/sqlite.py +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/localqueue/worker.py +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/tests/test_process_harness.py +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/tests/test_queue.py +0 -0
- {localqueue-0.3.3 → localqueue-0.3.4}/tests/test_retry.py +0 -0
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.4
|
|
4
|
+
|
|
5
|
+
- Keep `queue exec` and `queue process` alive in `--forever --block` mode when the queue starts empty.
|
|
6
|
+
- Preserve the batch empty-queue exit behavior for non-forever workers.
|
|
7
|
+
|
|
3
8
|
## 0.3.3
|
|
4
9
|
|
|
5
10
|
- Split queue and retry store implementations into dedicated modules.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: localqueue
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.4
|
|
4
4
|
Summary: Durable local queues for Python, with persistent retry state powered by Tenacity.
|
|
5
5
|
Project-URL: Homepage, https://brunoportis.github.io/localqueue/
|
|
6
6
|
Project-URL: Documentation, https://brunoportis.github.io/localqueue/
|
|
@@ -58,6 +58,7 @@ from localqueue.cli_worker_commands import (
|
|
|
58
58
|
)
|
|
59
59
|
from localqueue.services.queue_worker import (
|
|
60
60
|
QueueIterationContext as _QueueIterationContext,
|
|
61
|
+
QueueIterationResult as _QueueIterationResult,
|
|
61
62
|
QueueWorkerOptions as _QueueWorkerOptions,
|
|
62
63
|
_CommandExecutionError,
|
|
63
64
|
_CommandNotFoundError,
|
|
@@ -1747,6 +1748,55 @@ class CliTests(unittest.TestCase):
|
|
|
1747
1748
|
self.assertEqual(console.values, [])
|
|
1748
1749
|
self.assertEqual(err_console.messages, ["[yellow]queue is empty[/yellow]"])
|
|
1749
1750
|
|
|
1751
|
+
def test_process_queue_messages_keeps_waiting_when_forever_blocking_is_empty(
|
|
1752
|
+
self,
|
|
1753
|
+
) -> None:
|
|
1754
|
+
queue = PersistentQueue("emails", store=MemoryQueueStore())
|
|
1755
|
+
console = _JsonConsole()
|
|
1756
|
+
err_console = _JsonConsole()
|
|
1757
|
+
shutdown = _ShutdownState()
|
|
1758
|
+
|
|
1759
|
+
def stop_after_second_poll(
|
|
1760
|
+
context: _QueueIterationContext,
|
|
1761
|
+
) -> tuple[_QueueIterationResult | None, SQLiteAttemptStore | None, bool]:
|
|
1762
|
+
if shutdown.requested:
|
|
1763
|
+
return None, None, True
|
|
1764
|
+
shutdown.requested = True
|
|
1765
|
+
self.assertTrue(context.forever)
|
|
1766
|
+
self.assertTrue(context.block)
|
|
1767
|
+
return None, None, True
|
|
1768
|
+
|
|
1769
|
+
with mock.patch(
|
|
1770
|
+
"localqueue.services.queue_worker.process_queue_iteration",
|
|
1771
|
+
side_effect=stop_after_second_poll,
|
|
1772
|
+
) as process_iteration:
|
|
1773
|
+
result = _process_queue_messages(
|
|
1774
|
+
queue,
|
|
1775
|
+
lambda payload: payload,
|
|
1776
|
+
console=console,
|
|
1777
|
+
err_console=err_console,
|
|
1778
|
+
shutdown=shutdown,
|
|
1779
|
+
options=_QueueWorkerOptions(
|
|
1780
|
+
retry_store_path=self._retry_store_path(),
|
|
1781
|
+
max_jobs=1,
|
|
1782
|
+
forever=True,
|
|
1783
|
+
max_tries=1,
|
|
1784
|
+
worker_id="worker-a",
|
|
1785
|
+
block=True,
|
|
1786
|
+
timeout=None,
|
|
1787
|
+
idle_sleep=0.001,
|
|
1788
|
+
release_delay=0.0,
|
|
1789
|
+
dead_letter_on_exhaustion=True,
|
|
1790
|
+
log_events=False,
|
|
1791
|
+
mode="process",
|
|
1792
|
+
),
|
|
1793
|
+
)
|
|
1794
|
+
|
|
1795
|
+
self.assertEqual(result, 0)
|
|
1796
|
+
self.assertEqual(console.values, [{"state": "stopped", "processed": 0}])
|
|
1797
|
+
self.assertEqual(err_console.messages, [])
|
|
1798
|
+
self.assertEqual(process_iteration.call_count, 1)
|
|
1799
|
+
|
|
1750
1800
|
def test_process_queue_iteration_handles_forever_empty_queue_without_blocking(
|
|
1751
1801
|
self,
|
|
1752
1802
|
) -> None:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|