1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-06-26 02:19:22 +02:00

allow set client request/ws timeout

This commit is contained in:
Nikolay Kim
2018-03-18 19:27:51 -07:00
parent 6b1a79fab8
commit f4a47ef71e
3 changed files with 34 additions and 1 deletions

View File

@ -209,6 +209,15 @@ impl Client {
self
}
/// Set websocket handshake timeout
///
/// Handshake timeout is a total time for successful handshake.
/// Default value is 5 seconds.
pub fn timeout(mut self, timeout: Duration) -> Self {
self.request.timeout(timeout);
self
}
/// Connect to websocket server and do ws handshake
pub fn connect(&mut self) -> ClientHandshake {
if let Some(e) = self.err.take() {