[PR #413] [MERGED] refact: Simple message queue refactoring #448

Closed
opened 2026-02-16 01:17:24 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/run-llama/llama_deploy/pull/413
Author: @masci
Created: 12/20/2024
Status: Merged
Merged: 12/20/2024
Merged by: @masci

Base: mainHead: massi/simple-msg-queue


📝 Commits (10+)

📊 Changes

36 files changed (+591 additions, -962 deletions)

View changed files

📝 .pre-commit-config.yaml (+1 -1)
📝 e2e_tests/message_queues/message_queue_simple/test_message_queue.py (+2 -2)
📝 llama_deploy/__init__.py (+5 -2)
📝 llama_deploy/apiserver/deployment.py (+8 -7)
📝 llama_deploy/deploy/deploy.py (+4 -7)
📝 llama_deploy/message_consumers/base.py (+5 -3)
📝 llama_deploy/message_consumers/remote.py (+2 -1)
📝 llama_deploy/message_queues/__init__.py (+5 -3)
📝 llama_deploy/message_queues/base.py (+25 -42)
📝 llama_deploy/message_queues/simple/__init__.py (+4 -4)
📝 llama_deploy/message_queues/simple/client.py (+57 -85)
📝 llama_deploy/message_queues/simple/config.py (+12 -4)
📝 llama_deploy/message_queues/simple/server.py (+55 -269)
📝 llama_deploy/services/human.py (+8 -0)
📝 llama_deploy/services/tool.py (+12 -5)
📝 llama_deploy/services/workflow.py (+5 -13)
📝 pyproject.toml (+3 -2)
📝 tests/apiserver/test_deployment.py (+5 -5)
tests/conftest.py (+17 -0)
📝 tests/control_plane/test_server.py (+7 -6)

...and 16 more files

📄 Description

Fixes #361

While working on #361 I found out it wasn't that easy to introduce the concept of topic in SimpleMessageQueue because there wasn't a clear separation between "client" and "server". With other flavors of message queues, the client is the one responsible for managing consumers, while the server is the actual broker service (Redis, Kafka and the likes). But the simple message queue also has a "server" part that acts as an in-memory storage.

With this PR, the server and the client are clearly separated, and only SimpleMessageQueue derives from AbstractMessageQueue, while the server class is just an object. This way, the simple message queue isn't special anymore, and it behaves exactly like the others.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/run-llama/llama_deploy/pull/413 **Author:** [@masci](https://github.com/masci) **Created:** 12/20/2024 **Status:** ✅ Merged **Merged:** 12/20/2024 **Merged by:** [@masci](https://github.com/masci) **Base:** `main` ← **Head:** `massi/simple-msg-queue` --- ### 📝 Commits (10+) - [`6456be2`](https://github.com/run-llama/llama_deploy/commit/6456be2b0a01d47c7dd45e183ee41ada2d2fcfc4) cosmetics - [`f33cf86`](https://github.com/run-llama/llama_deploy/commit/f33cf8624c8ab2e5b2613386d75089e920c431c0) remove internal port concept - [`df82ffb`](https://github.com/run-llama/llama_deploy/commit/df82ffbe35e8a9dc192f48ef006add37f23d76a1) derive from AbstractMessageQueue - [`41b0206`](https://github.com/run-llama/llama_deploy/commit/41b02062fa84b52634dba713f8abbe5ed23863aa) first draft - [`a49e2dc`](https://github.com/run-llama/llama_deploy/commit/a49e2dc6a8c1949ae0996302347215a342fd5909) rewrite unit tests - [`483e614`](https://github.com/run-llama/llama_deploy/commit/483e614e1f904ea170bd505eee3e523c3e5613ae) fix tests - [`df1fb27`](https://github.com/run-llama/llama_deploy/commit/df1fb27dd21954807d1d9acfb889d5686673de23) skip tool tests - [`680af0a`](https://github.com/run-llama/llama_deploy/commit/680af0a9fcfa6bd3b78769e25ac7f025d4c80bf4) fix e2e tests - [`b330aac`](https://github.com/run-llama/llama_deploy/commit/b330aacc26c4ed6f9a7f0a289a4e05123406ed72) fix linter - [`94d9de7`](https://github.com/run-llama/llama_deploy/commit/94d9de762d71c4cc3a310284a91fb0be3254414f) exclude untested code from coverage ### 📊 Changes **36 files changed** (+591 additions, -962 deletions) <details> <summary>View changed files</summary> 📝 `.pre-commit-config.yaml` (+1 -1) 📝 `e2e_tests/message_queues/message_queue_simple/test_message_queue.py` (+2 -2) 📝 `llama_deploy/__init__.py` (+5 -2) 📝 `llama_deploy/apiserver/deployment.py` (+8 -7) 📝 `llama_deploy/deploy/deploy.py` (+4 -7) 📝 `llama_deploy/message_consumers/base.py` (+5 -3) 📝 `llama_deploy/message_consumers/remote.py` (+2 -1) 📝 `llama_deploy/message_queues/__init__.py` (+5 -3) 📝 `llama_deploy/message_queues/base.py` (+25 -42) 📝 `llama_deploy/message_queues/simple/__init__.py` (+4 -4) 📝 `llama_deploy/message_queues/simple/client.py` (+57 -85) 📝 `llama_deploy/message_queues/simple/config.py` (+12 -4) 📝 `llama_deploy/message_queues/simple/server.py` (+55 -269) 📝 `llama_deploy/services/human.py` (+8 -0) 📝 `llama_deploy/services/tool.py` (+12 -5) 📝 `llama_deploy/services/workflow.py` (+5 -13) 📝 `pyproject.toml` (+3 -2) 📝 `tests/apiserver/test_deployment.py` (+5 -5) ➕ `tests/conftest.py` (+17 -0) 📝 `tests/control_plane/test_server.py` (+7 -6) _...and 16 more files_ </details> ### 📄 Description Fixes #361 While working on #361 I found out it wasn't that easy to introduce the concept of topic in `SimpleMessageQueue` because there wasn't a clear separation between "client" and "server". With other flavors of message queues, the client is the one responsible for managing consumers, while the server is the actual broker service (Redis, Kafka and the likes). But the simple message queue also has a "server" part that acts as an in-memory storage. With this PR, the server and the client are clearly separated, and only `SimpleMessageQueue` derives from `AbstractMessageQueue`, while the server class is just an object. This way, the simple message queue isn't special anymore, and it behaves exactly like the others. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 01:17:24 -05:00
yindo closed this issue 2026-02-16 01:17:24 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/llama_deploy#448