(&self, sandbox_id: &str)
| 27 | } |
| 28 | |
| 29 | fn sender_for(&self, sandbox_id: &str) -> broadcast::Sender<()> { |
| 30 | let mut inner = self.inner.lock().expect("sandbox watch bus lock poisoned"); |
| 31 | inner |
| 32 | .entry(sandbox_id.to_string()) |
| 33 | .or_insert_with(|| { |
| 34 | // Small buffer; lag is handled best-effort by the stream. |
| 35 | let (tx, _rx) = broadcast::channel(128); |
| 36 | tx |
| 37 | }) |
| 38 | .clone() |
| 39 | } |
| 40 | |
| 41 | /// Notify watchers that the sandbox record has changed. |
| 42 | pub fn notify(&self, sandbox_id: &str) { |