goraft/raft — pull request #144 by benbjohnson (2013-12-29 20:02:25+00:00)
Title: Election Threshold and Heartbeat Timeout Event Types

## Overview

This pull request adds two new event types:

* `HeartbeatTimeoutEventType` - Dispatched when a heartbeat times out. This requires that the transporter returns a `nil` for timed out requests.

* `ElectionTimeoutThresholdEventType` - Dispatched when an `AppendEntries` request comes within a given threshold of the election timeout. This threshold is currently set to `80%` of the election timeout.

This will give Raft users better insight into whether their heartbeat and election timeouts are too low.

@philips: We can add exponential backoff of notification of these events at the application level. I'd rather dispatch all events at the go-raft library level and not filter any out.

/cc: @xiangli-cmu