Skip to content

Commit

Permalink
Merge pull request #194 from Tim-Zhang/backport-for-0.5
Browse files Browse the repository at this point in the history
[0.5.0] Backport features about async-client's sending requests via a `&Client`
  • Loading branch information
Tim-Zhang authored Jun 19, 2023
2 parents e211596 + 986b933 commit 8968bfa
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ttrpc"
version = "0.5.3"
version = "0.5.4"
authors = ["The AntFin Kata Team <[email protected]>"]
edition = "2018"
license = "Apache-2.0"
Expand Down
8 changes: 4 additions & 4 deletions example/async-client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ use ttrpc::r#async::Client;
#[tokio::main(flavor = "current_thread")]
async fn main() {
let c = Client::connect("unix:///tmp/1").unwrap();
let mut hc = health_ttrpc::HealthClient::new(c.clone());
let mut ac = agent_ttrpc::AgentServiceClient::new(c);
let hc = health_ttrpc::HealthClient::new(c.clone());
let ac = agent_ttrpc::AgentServiceClient::new(c);

let mut thc = hc.clone();
let mut tac = ac.clone();
let thc = hc.clone();
let tac = ac.clone();

let now = std::time::Instant::now();

Expand Down
2 changes: 1 addition & 1 deletion src/asynchronous/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ impl Client {
Client { req_tx }
}

pub async fn request(&mut self, req: Request) -> Result<Response> {
pub async fn request(&self, req: Request) -> Result<Response> {
let mut buf = Vec::with_capacity(req.compute_size() as usize);
{
let mut s = CodedOutputStream::vec(&mut buf);
Expand Down
4 changes: 2 additions & 2 deletions ttrpc-codegen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ttrpc-codegen"
version = "0.2.3"
version = "0.2.4"
edition = "2018"
authors = ["The AntFin Kata Team <[email protected]>"]
license = "Apache-2.0"
Expand All @@ -18,4 +18,4 @@ protobuf = "2.28.0"
protobuf-codegen = { package = "protobuf-codegen3", version = "2.28.2" }
# protobuf-codegen-pure3 is a protobuf-codegen-pure version that supports proto3 optional fields
protobuf-codegen-pure = { package = "protobuf-codegen-pure3", version = "2.28.2" }
ttrpc-compiler = "0.4.3"
ttrpc-compiler = "0.4.4"

0 comments on commit 8968bfa

Please sign in to comment.