(&self, event: WatchSandboxesEvent)
| 1081 | } |
| 1082 | |
| 1083 | async fn apply_watch_event(&self, event: WatchSandboxesEvent) -> Result<(), String> { |
| 1084 | match event.payload { |
| 1085 | Some(watch_sandboxes_event::Payload::Sandbox(sandbox)) => { |
| 1086 | if let Some(sandbox) = sandbox.sandbox { |
| 1087 | self.apply_sandbox_update(sandbox).await?; |
| 1088 | } |
| 1089 | } |
| 1090 | Some(watch_sandboxes_event::Payload::Deleted(deleted)) => { |
| 1091 | self.apply_deleted(&deleted.sandbox_id).await?; |
| 1092 | } |
| 1093 | Some(watch_sandboxes_event::Payload::PlatformEvent(platform_event)) => { |
| 1094 | if let Some(event) = platform_event.event { |
| 1095 | self.tracing_log_bus.platform_event_bus.publish( |
| 1096 | &platform_event.sandbox_id, |
| 1097 | openshell_core::proto::SandboxStreamEvent { |
| 1098 | payload: Some( |
| 1099 | openshell_core::proto::sandbox_stream_event::Payload::Event( |
| 1100 | public_platform_event_from_driver(&event), |
| 1101 | ), |
| 1102 | ), |
| 1103 | }, |
| 1104 | ); |
| 1105 | } |
| 1106 | } |
| 1107 | None => {} |
| 1108 | } |
| 1109 | Ok(()) |
| 1110 | } |
| 1111 | |
| 1112 | async fn apply_sandbox_update(&self, incoming: DriverSandbox) -> Result<(), String> { |
| 1113 | let _guard = self.sync_lock.lock().await; |
nothing calls this directly
no test coverage detected