doc(tokio): Set keep_alive to false on hyper clients.

This prevents hanging event loops.
This commit is contained in:
Lewin Bormann
2019-06-13 18:41:09 +02:00
parent f034b8bea4
commit 0eb1268567
4 changed files with 16 additions and 9 deletions

View File

@@ -16,6 +16,10 @@ use std::sync::{Arc, Mutex};
///
/// `ServiceAccountAccess` does not need (and does not work) with `Authenticator`, given that it
/// does not require interaction and implements its own caching. Use it directly.
///
/// NOTE: It is recommended to use a client constructed like this in order to prevent functions
/// like `hyper::run()` from hanging: `let client = hyper::Client::builder().keep_alive(false);`.
/// Due to token requests being rare, this should not result in a too bad performance problem.
pub struct Authenticator<
T: GetToken,
S: TokenStorage,