Replace the dropper with a new one and return the existing one so that we can await all the drop tasks being completed.
(&mut self)
| 274 | |
| 275 | /// Replace the dropper with a new one and return the existing one so that we can await all the drop tasks being completed. |
| 276 | pub fn take_dropper(&mut self) -> DropHandle { |
| 277 | let (mut drop_handle, mut drop_chute) = dropper::start(self.docker.clone()); |
| 278 | std::mem::swap(&mut drop_handle, &mut self.drop_handle); |
| 279 | std::mem::swap(&mut drop_chute, &mut self.drop_chute); |
| 280 | // By dropping the `drop_chute` the only the existing docker constructs will keep a reference to it. |
| 281 | // The caller can decide when it's time to wait on the handle, when the testnet have been dropped. |
| 282 | drop_handle |
| 283 | } |
| 284 | |
| 285 | /// Path to a directory based on a resource name. |
| 286 | fn path<T: AsRef<ResourceName>>(&self, name: T) -> PathBuf { |