Skip to content

[executor] 抽取 _to_worker_request 统一实现 #19

Description

@beachspainc

现象

_to_worker_requestwshttp 两个 Node 后端实现中重复定义,逻辑几乎一致(参数提取 + call_id/node_id 校验 + 构造 WorkerRequest)。

重复位置:

  • src/cobnet/executor/runner/backend/node/ws/client.py:114
  • src/cobnet/executor/runner/backend/node/http/client.py:125

建议

  • 提取到基类/共享工厂方法,减少 transport 层重复实现
  • 统一错误文案与参数校验(call_id/node_id 非空)
  • 继续保留 transport 特有发送细节在各子类中

价值

  • 避免未来新增 transport 时重复实现该映射语义
  • 统一约定有利于回归一致性

与已存在 issue 的关系

当前 open issue 中 #8-15 分别聚焦 backplane 底层 helper,未覆盖该 transport 端 helper。

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions