Handles an Uninterest request, possibly cleaning up dataflows that are no longer interesting to any client.
(&mut self, client: Token, name: &str)
| 489 | /// Handles an Uninterest request, possibly cleaning up dataflows |
| 490 | /// that are no longer interesting to any client. |
| 491 | pub fn uninterest(&mut self, client: Token, name: &str) -> Result<(), Error> { |
| 492 | // All workers keep track of every client's interests, s.t. they |
| 493 | // know when to clean up unused dataflows. |
| 494 | if let Some(entry) = self.interests.get_mut(name) { |
| 495 | entry.remove(&client); |
| 496 | |
| 497 | if entry.is_empty() { |
| 498 | self.shutdown_query(name); |
| 499 | self.interests.remove(name); |
| 500 | } |
| 501 | } |
| 502 | |
| 503 | Ok(()) |
| 504 | } |
| 505 | |
| 506 | /// Cleans up all bookkeeping state for the specified client. |
| 507 | pub fn disconnect_client(&mut self, client: Token) -> Result<(), Error> { |
no test coverage detected