(payload: &mut Json, id: &str)
| 717 | } |
| 718 | |
| 719 | fn set_request_id(payload: &mut Json, id: &str) -> FlowResult<()> { |
| 720 | let object = payload.as_object_mut().ok_or_else(|| { |
| 721 | FlowError::Internal("worker command payload must be a JSON object".to_string()) |
| 722 | })?; |
| 723 | object.insert("id".to_string(), Json::String(id.to_string())); |
| 724 | Ok(()) |
| 725 | } |
| 726 | |
| 727 | fn dispatch_worker_envelope( |
| 728 | waiters: &Arc<Mutex<HashMap<String, std_mpsc::Sender<WorkerEnvelope>>>>, |