()
| 291 | |
| 292 | #[tokio::test] |
| 293 | async fn tenant_isolation() { |
| 294 | let bus = NotifyBus::new(64); |
| 295 | let t1 = tenant(1); |
| 296 | let t2 = tenant(2); |
| 297 | let (_, mut rx1) = bus.listen(t1, "ch"); |
| 298 | let (_, mut rx2) = bus.listen(t2, "ch"); |
| 299 | bus.notify(t1, "ch", "for-t1"); |
| 300 | // t1 receives; t2 does not. |
| 301 | assert!(rx1.try_recv().is_ok()); |
| 302 | assert!(rx2.try_recv().is_err()); |
| 303 | } |
| 304 | |
| 305 | #[tokio::test] |
| 306 | async fn queue_full_increments_dropped() { |