| 88 | |
| 89 | protected: |
| 90 | void initialize() override |
| 91 | { |
| 92 | // Stop when no one cares. |
| 93 | promise.future().onDiscard(lambda::bind( |
| 94 | static_cast<void(*)(const UPID&, bool)>(terminate), self(), true)); |
| 95 | |
| 96 | // Wait until there are enough (i.e., quorum of) replicas in the |
| 97 | // network. This is because if there are less than quorum number |
| 98 | // of replicas in the network, the operation will not finish. |
| 99 | network->watch(quorum, Network::GREATER_THAN_OR_EQUAL_TO) |
| 100 | .onAny(defer(self(), &Self::watched, lambda::_1)); |
| 101 | } |
| 102 | |
| 103 | void finalize() override |
| 104 | { |