zebrad: clarify hedge layering motivation

Co-authored-by: teor <teor@riseup.net>
This commit is contained in:
Henry de Valence 2020-10-24 17:15:42 -07:00
parent 6f8f8a56d4
commit 4127d086ea
1 changed files with 5 additions and 0 deletions

View File

@ -143,6 +143,11 @@ where
// layer is relatively unimportant, because slow requests will
// probably be pre-emptively hedged.
//
// The Hedge goes outside the Retry, because the Retry layer
// abstracts away spurious failures from individual peers
// making a less-fallible network service, and the Hedge layer
// tries to reduce latency of that less-fallible service.
//
// XXX add ServiceBuilder::hedge() so this becomes
// ServiceBuilder::new().hedge(...).retry(...)...
let block_network = Hedge::new(