pub async fn start_exec_stream(
req: ExecRequest,
) -> Result<String, ServerFnError>Expand description
提交一次流式代码执行请求。
校验链与 start_exec 完全一致(速率限制 + 白名单 + 大小),返回 task_id。
前端拿到 task_id 后用 EventSource 连 GET /api/exec/stream?task_id=X,
SSE handler 从 EXEC_STREAMS 取走 receiver 做流式输出。
后台 spawn 与 start_exec 并行写两处:
run_in_container_stream推 chunk 到 SSE(流式路径)update_task_result写EXEC_TASKS(轮询兜底路径,SSE 不可用或 Tiptap 编辑器用)
§Handler information
- Method:
post - Path:
<auto>