| 1654 | |
| 1655 | |
| 1656 | static void __destroy( |
| 1657 | const Future<Nothing>& future, |
| 1658 | const Owned<Promise<Nothing>>& promise, |
| 1659 | const Duration& timeout) |
| 1660 | { |
| 1661 | if (future.isReady()) { |
| 1662 | promise->set(future.get()); |
| 1663 | } else if (future.isFailed()) { |
| 1664 | promise->fail(future.failure()); |
| 1665 | } else { |
| 1666 | promise->fail("Timed out after " + stringify(timeout)); |
| 1667 | } |
| 1668 | } |
| 1669 | |
| 1670 | |
| 1671 | static Future<Nothing> _destroy( |