Skip to content

Commit

Permalink
temp bugfix: for some reason, async traits don't seem to handle futur…
Browse files Browse the repository at this point in the history
…es in impls correctly.

the error seems to be because the runtime environment is not accessible/out of scope
  • Loading branch information
DominicBurkart committed Oct 21, 2020
1 parent 0e23825 commit 39fffe1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion turbolift_internals/src/kubernetes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,10 @@ impl DistributionPlatform for K8s {
let service_base_url = self.fn_names_to_services.get(function_name).unwrap();
let args = "./".to_string() + function_name + "/" + &params;
let query_url = service_base_url.join(&args)?;
let response = self.get(query_url).await?;

let mut rt = tokio::runtime::Runtime::new().unwrap();
let response = rt.block_on(self.get(query_url))?;
// ^ todo find out why this code errors if we don't spawn another runtime here
Ok(response)
}

Expand Down
5 changes: 4 additions & 1 deletion turbolift_internals/src/local_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ impl DistributionPlatform for LocalQueue {
// request from server
let prefixed_params = "./".to_string() + function_name + "/" + &params;
let query_url = address_and_port.join(&prefixed_params)?;
let response = Self::get(query_url).await;

let mut rt = tokio::runtime::Runtime::new().unwrap();
let response = rt.block_on(Self::get(query_url));
// ^ todo find out why this code errors if we don't spawn another runtime here
Ok(response)
}

Expand Down

0 comments on commit 39fffe1

Please sign in to comment.