Skip to content

[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
ji-huazhong:refactor
Open

[client, storage] refactor: unify dynamic ZMQ socket decorator between simple_backend_manager and client#66
ji-huazhong wants to merge 3 commits intoAscend:mainfrom
ji-huazhong:refactor

Conversation

@ji-huazhong
Copy link
Copy Markdown
Collaborator

as title.

… client

Signed-off-by: ji-huazhong <hzji210@gmail.com>
@ascend-robot
Copy link
Copy Markdown

CLA Signature Pass

ji-huazhong, thanks for your pull request. All authors of the commits have signed the CLA. 👍

Signed-off-by: ji-huazhong <hzji210@gmail.com>
@ascend-robot
Copy link
Copy Markdown

CLA Signature Pass

ji-huazhong, thanks for your pull request. All authors of the commits have signed the CLA. 👍

@ji-huazhong ji-huazhong changed the title unify dynamic ZMQ socket decorator between simple_backend_manager and client [client, storage] refactor: unify dynamic ZMQ socket decorator between simple_backend_manager and client Mar 29, 2026
@0oshowero0 0oshowero0 requested a review from Copilot March 29, 2026 13:35
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 using dynamic_zmq_socket().
  • Replaced AsyncSimpleStorageManager.dynamic_storage_manager_socket() with a pre-bound module-level decorator using dynamic_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>
@ascend-robot
Copy link
Copy Markdown

CLA Signature Pass

ji-huazhong, thanks for your pull request. All authors of the commits have signed the CLA. 👍

return socket


def dynamic_zmq_socket(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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=...,
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants