-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fetch: replace futures-timer with tokio-timer #9066
Conversation
ee8a082 to
977d045
Compare
util/fetch/src/client.rs
Outdated
| pub struct Client { | ||
| core: mpsc::Sender<ChanItem>, | ||
| refs: Arc<AtomicUsize>, | ||
| timer: Timer, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/spaces/tab
util/fetch/src/client.rs
Outdated
| Client { | ||
| core: self.core.clone(), | ||
| refs: self.refs.clone(), | ||
| timer: self.timer.clone(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/spaces/tab
util/fetch/src/client.rs
Outdated
| Ok(Client { | ||
| core: tx_proto, | ||
| refs: Arc::new(AtomicUsize::new(1)), | ||
| timer: Timer::default(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/spaces/tab
util/fetch/src/client.rs
Outdated
| Box::new(future) | ||
| .and_then(future::result); | ||
|
|
||
| Box::new(self.timer.timeout(future, maxdur)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/spaces/tab
util/fetch/src/client.rs
Outdated
| /// Too many redirects have been encountered. | ||
| TooManyRedirects, | ||
| /// tokio-timer gave us an error. | ||
| Timer(tokio_timer::TimerError), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/spaces/tab
| tokio_timer::TimeoutError::TimedOut(_) => Error::Timeout, | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/spaces/tab
niklasad1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good just replace the spaces with tabs!
util/fetch/src/client.rs
Outdated
| let d = Duration::from_secs(req.uri().query().unwrap_or("0").parse().unwrap()); | ||
| Box::new(Delay::new(d).from_err().map(|_| Response::new())) | ||
| Box::new(self.0.sleep(d) | ||
| .map_err(|_| return io::Error::new(io::ErrorKind::Other, "timer error")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/spaces/tab
|
Yeah I had editorconfig disabled because I was having some issues with magit. I will reformat everything and squash. |
Currently the coverage build fails because `futures-timer` fails to compile with `-C link-dead-code`. This issue has been reported to `futures-timer` (async-rs/futures-timer#2) but has remained unsolved for months. It should be fixed by rustc eventually (rust-lang/rust#45629).
977d045 to
6c25589
Compare
3850a34 to
b464bd1
Compare
|
Successful coverage build: https://gitlab.parity.io/parity/parity/-/jobs/91344 |
|
Amazing! |
|
Better coverage report that doesn't include the |
71ee31d to
f335830
Compare
ascjones
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
* master: fetch: replace futures-timer with tokio-timer (#9066)
…rp_sync_on_light_client * 'master' of https://github.com/paritytech/parity: docs: add changelog for 1.10.9 stable and 1.11.6 beta (openethereum#9069) Enable test in `miner/pool/test` (openethereum#9072) fetch: replace futures-timer with tokio-timer (openethereum#9066) remove util-error (openethereum#9054)
Currently the coverage build fails because
futures-timerfails to compile with-C link-dead-code(https://gitlab.parity.io/parity/parity/-/jobs/91245). This issue has been reported tofutures-timer(async-rs/futures-timer#2) but has remained unsolved for months. It should be fixed by rustc eventually (rust-lang/rust#45629).