[client, storage] refactor: unify dynamic ZMQ socket decorator between simple_backend_manager and client#66
Conversation
CLA Signature Passji-huazhong, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
1 similar comment
CLA Signature Passji-huazhong, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
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.
CLA Signature Passji-huazhong, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
| return socket | ||
|
|
||
|
|
||
| def dynamic_zmq_socket( |
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=...,
)… client Signed-off-by: ji-huazhong <hzji210@gmail.com>
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. 👍 |
1 similar comment
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. 👍 |
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. 👍 |
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. 👍 |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Pre-bound decorator for storage-unit socket operations. | ||
| with_storage_unit_socket = with_zmq_socket( | ||
| "put_get_socket", | ||
| get_identity=lambda self: self.storage_manager_id, | ||
| get_peer=lambda self, target: self.storage_unit_infos[target], |
| # Pre-bound decorator for controller socket operations. | ||
| with_controller_socket = with_zmq_socket( | ||
| "request_handle_socket", | ||
| get_identity=lambda self: self.client_id, | ||
| get_peer=lambda self, target: self._controller, |
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. 👍 |
…n simple_backend_manager and client (Ascend#66) as title. --------- Signed-off-by: ji-huazhong <hzji210@gmail.com>
…n simple_backend_manager and client (Ascend#66) as title. --------- Signed-off-by: ji-huazhong <hzji210@gmail.com>
as title.