TunnelProxy.PTYPool (tunnel_proxy v0.3.4)

Copy Markdown

每个 agent_id 对应一个持久 ExPTY shell 进程。 shell 在 agent 首次 exec 时懒创建,exit 后自动从 pool 移除。

Summary

Functions

Returns a specification to start this module under a supervisor.

向 agent 的 PTY 会话提交命令,返回 {:ok, task_id} 或 {:error, :busy}

Callback implementation for GenServer.init/1.

强制终止 agent 的 shell 会话

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

exec(agent_id, task_id, cmd)

向 agent 的 PTY 会话提交命令,返回 {:ok, task_id} 或 {:error, :busy}

init(_)

Callback implementation for GenServer.init/1.

kill(agent_id)

强制终止 agent 的 shell 会话

start_link(opts)