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:
@ -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() {
|
||||
|
Reference in New Issue
Block a user