void Elector::reset_timer(double plus)
{
+ /**
+ * This class is used as the callback when the expire_event timer fires up.
+ *
+ * If the expire_event is fired, then it means that we had an election going,
+ * either started by us or by some other participant, but it took too long,
+ * thus expiring.
+ *
+ * When the election expires, we will check if we were the ones who won, and
+ * if so we will declare victory. If that is not the case, then we assume
+ * that the one we defered to didn't declare victory quickly enough (in fact,
+ * as far as we know, we may even be dead); so, just propose ourselves as the
+ * Leader.
+ */
+ class C_ElectionExpire : public Context {
+ Elector *elector;
+ public:
+ explicit C_ElectionExpire(Elector *e) : elector(e) { }
+ void finish(int r) {
+ elector->expire();
+ }
+ };
// set the timer
cancel_timer();
expire_event = new C_ElectionExpire(this);
*/
void bump_epoch(epoch_t e);
- /**
- * @defgroup Elector_h_callbacks Callbacks
- * @{
- */
- /**
- * This class is used as the callback when the expire_event timer fires up.
- *
- * If the expire_event is fired, then it means that we had an election going,
- * either started by us or by some other participant, but it took too long,
- * thus expiring.
- *
- * When the election expires, we will check if we were the ones who won, and
- * if so we will declare victory. If that is not the case, then we assume
- * that the one we defered to didn't declare victory quickly enough (in fact,
- * as far as we know, we may even be dead); so, just propose ourselves as the
- * Leader.
- */
- class C_ElectionExpire : public Context {
- Elector *elector;
- public:
- explicit C_ElectionExpire(Elector *e) : elector(e) { }
- void finish(int r) {
- elector->expire();
- }
- };
- /**
- * @}
- */
-
/**
* Start new elections by proposing ourselves as the new Leader.
*