Returns None if we need to re-run the protocol.
| 167 | |
| 168 | // Returns None if we need to re-run the protocol. |
| 169 | Future<Option<RecoverResponse>> receive() |
| 170 | { |
| 171 | if (responses.empty()) { |
| 172 | // All responses have been received but we haven't received |
| 173 | // enough (i.e., a quorum of) responses from VOTING replicas to |
| 174 | // start the catch-up. We will re-run the recovery protocol. |
| 175 | return None(); |
| 176 | } |
| 177 | |
| 178 | // Instead of using a for loop here, we use select to process |
| 179 | // responses one after another so that we can ignore the rest if |
| 180 | // we have collected enough responses. |
| 181 | return select(responses) |
| 182 | .then(defer(self(), &Self::received, lambda::_1)); |
| 183 | } |
| 184 | |
| 185 | Future<Option<RecoverResponse>> received( |
| 186 | const Future<RecoverResponse>& future) |