Update jsonrpc dependencies and rewrite dapps to futures. (#6522)
* Bump version. * Fix RPC crate. * Fix BoxFuture in crates. * Compiles and passes tests! * Get rid of .boxed() * Fixing issues with the UI. * Remove minihttp. Support threads. * Reimplement files serving to do it in chunks. * Increase chunk size. * Remove some unecessary copying. * Fix tests. * Fix stratum warning and ipfs todo. * Switch to proper branch of jsonrpc. * Update Cargo.lock. * Update docs. * Include dapps-glue in workspace. * fixed merge artifacts * Fix test compilation.
This commit is contained in:
committed by
Arkadiy Paronyan
parent
492da38d67
commit
e8b418ca03
@@ -92,7 +92,7 @@ impl<F: Fetch> Client<F> {
|
||||
|
||||
/// Gets the current ETH price and calls `set_price` with the result.
|
||||
pub fn get<G: Fn(PriceInfo) + Sync + Send + 'static>(&self, set_price: G) {
|
||||
self.fetch.forget(self.fetch.fetch(&self.api_endpoint)
|
||||
self.fetch.process_and_forget(self.fetch.fetch(&self.api_endpoint)
|
||||
.map_err(|err| Error::Fetch(err))
|
||||
.and_then(move |mut response| {
|
||||
if !response.is_success() {
|
||||
@@ -156,10 +156,11 @@ mod test {
|
||||
}
|
||||
|
||||
// this guarantees that the calls to price_info::Client::get will block for execution
|
||||
fn forget<F, I, E>(&self, f: F) where
|
||||
fn process_and_forget<F, I, E>(&self, f: F) where
|
||||
F: Future<Item=I, Error=E> + Send + 'static,
|
||||
I: Send + 'static,
|
||||
E: Send + 'static {
|
||||
E: Send + 'static,
|
||||
{
|
||||
let _ = f.wait();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user