Skip to content

Commit

Permalink
Migrated Exit Manager and QueryExitDebts to async await.
Browse files Browse the repository at this point in the history
Removed the futures based http client in these handlers and replaced them
with the async http client 'awc'
  • Loading branch information
Pranay Tulugu committed Sep 2, 2021
1 parent ddf1674 commit 093e1ab
Show file tree
Hide file tree
Showing 7 changed files with 407 additions and 410 deletions.
37 changes: 36 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions rita_client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ sodiumoxide = "0.2"
clu = { path = "../clu" }
web30 = {git = "https://github.com/althea-net/web30", rev = "a600b8b8ebf2c49badee6b65ac90a56bbdad4ab9"}
actix = "0.7"
awc = "3.0.0-beta.7"
actix-async = {package="actix", version = "0.12"}
actix-web = { version = "0.7", default_features = false, features= ["ssl"] }
clarity = "0.4"

Expand Down
4 changes: 2 additions & 2 deletions rita_client/src/dashboard/prices.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::traffic_watcher::GetExitDestPrice;
use crate::traffic_watcher::TrafficWatcher;
use crate::traffic_watcher::TrafficWatcherActor;

use actix::SystemService;
use actix_web::Path;
Expand Down Expand Up @@ -47,7 +47,7 @@ pub fn get_prices(_req: HttpRequest) -> Box<dyn Future<Item = Json<Prices>, Erro
debug!("/prices GET hit");

let payment = settings::get_rita_client().payment;
let f = TrafficWatcher::from_registry().send(GetExitDestPrice);
let f = TrafficWatcherActor::from_registry().send(GetExitDestPrice);
let b = f.from_err().and_then(move |exit_dest_price| {
let exit_dest_price = exit_dest_price.unwrap();
let simulated_tx_fee = payment.simulated_transaction_fee;
Expand Down
Loading

0 comments on commit 093e1ab

Please sign in to comment.