(&self, event: &str, payload: &str)
| 53 | } |
| 54 | |
| 55 | pub async fn notify(&self, event: &str, payload: &str) -> Result<()> { |
| 56 | match Platform::detect_or_dstack() { |
| 57 | Platform::Dstack => {} |
| 58 | Platform::Gcp | Platform::NitroEnclave => { |
| 59 | // Skip notify on unsupported platforms |
| 60 | return Ok(()); |
| 61 | } |
| 62 | } |
| 63 | let Some(client) = &self.client else { |
| 64 | return Ok(()); |
| 65 | }; |
| 66 | client |
| 67 | .notify(Notification { |
| 68 | event: event.to_string(), |
| 69 | payload: payload.to_string(), |
| 70 | }) |
| 71 | .await?; |
| 72 | Ok(()) |
| 73 | } |
| 74 | |
| 75 | pub async fn notify_q(&self, event: &str, payload: &str) { |
| 76 | if let Err(err) = self.notify(event, payload).await { |
no outgoing calls
no test coverage detected