[client, storage] refactor: unify dynamic ZMQ socket decorator between simple_backend_manager and client#66
Open
ji-huazhong wants to merge 3 commits intoAscend:mainfrom
Open
[client, storage] refactor: unify dynamic ZMQ socket decorator between simple_backend_manager and client#66ji-huazhong wants to merge 3 commits intoAscend:mainfrom
ji-huazhong wants to merge 3 commits intoAscend:mainfrom
Conversation
… client Signed-off-by: ji-huazhong <hzji210@gmail.com>
CLA Signature Passji-huazhong, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
CLA Signature Passji-huazhong, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors TransferQueue’s ZMQ request-socket lifecycle handling by introducing a shared async decorator in zmq_utils and reusing it in both the client and simple storage backend manager.
Changes:
- Added
dynamic_zmq_socket()utility decorator to centralize ZMQ context/socket creation, connect, injection, and cleanup. - Replaced
AsyncTransferQueueClient.dynamic_socket()with a pre-bound module-level decorator usingdynamic_zmq_socket(). - Replaced
AsyncSimpleStorageManager.dynamic_storage_manager_socket()with a pre-bound module-level decorator usingdynamic_zmq_socket().
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
transfer_queue/utils/zmq_utils.py |
Introduces shared dynamic_zmq_socket() decorator for async request sockets. |
transfer_queue/storage/managers/simple_backend_manager.py |
Switches storage-unit request methods to use the shared decorator. |
transfer_queue/client.py |
Switches controller request methods to use the shared decorator. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: ji-huazhong <hzji210@gmail.com>
CLA Signature Passji-huazhong, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
0oshowero0
reviewed
Mar 29, 2026
| return socket | ||
|
|
||
|
|
||
| def dynamic_zmq_socket( |
Collaborator
There was a problem hiding this comment.
consider
with_zmq_socket(
"put_get_socket",
get_identity=lambda self: self.storage_manager_id,
get_peer=lambda self, target: self.storage_unit_infos[target],
resolve_target=lambda args, kwargs: kwargs.get("target_storage_unit"),
timeout=...,
)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
as title.