You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm writing an SSE (server-sent events) client that processes a chunked response, with a server-supplied expected max time. So it'd be great to be able to reset the timeout when a new message is received. Is this possible currently? (If not then this is a request for enhancement :))
Last but not least, many thanks for this great library!
The text was updated successfully, but these errors were encountered:
Do I get this right, you want to be able to set the socket.set_read_timeout(n) also after you sent the request, i.e. when you have the Response object?
I'm not familiar with the low-level API, but something like that, yes :)
An excerpt from the current version:
use std::io::{BufRead,BufReader,Write};// ...let result = ureq::get(&conf.url).timeout(Duration::from_secs(conf.first_byte_timeout_secasu64)).call();match result {Ok(response) => process(response)Err ...
}fnprocess(response:Response){letmut buf:Vec<String> = Vec::with_capacity(10);let reader = response.into_reader();let bufreader = BufReader::new(reader);for line in bufreader.lines(){// match ..// ... I guess this is where I'd reset the timeout after each "line"}}
Hello,
I'm writing an SSE (server-sent events) client that processes a chunked response, with a server-supplied expected max time. So it'd be great to be able to reset the timeout when a new message is received. Is this possible currently? (If not then this is a request for enhancement :))
Last but not least, many thanks for this great library!
The text was updated successfully, but these errors were encountered: