Skip to content

Commit 4c01bae

Browse files
authored
update pajamax to v0.2.0 (#520)
1 parent dc5f6e7 commit 4c01bae

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

rust_pajamax_bench/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rust_pajamax"
3-
version = "0.1.0"
3+
version = "0.2.0"
44
authors = ["Wu Bingzheng <wubingzheng@gmail.com>"]
55
edition = "2021"
66
license = "MIT"
@@ -10,9 +10,9 @@ name = "helloworld"
1010
path = "src/helloworld.rs"
1111

1212
[dependencies]
13-
pajamax = "0.1.1"
13+
pajamax = "0.2.0"
1414
prost = "0.13.5"
1515

1616
[build-dependencies]
17-
pajamax-build = "0.1.0"
17+
pajamax-build = "0.2.0"
1818
prost-build = "0.13.5"

rust_pajamax_bench/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
fn main() -> Result<(), Box<dyn std::error::Error>> {
2-
pajamax_build::compile_protos(&["proto/helloworld/helloworld.proto"], &["."])?;
2+
pajamax_build::compile_protos_in_local(&["proto/helloworld/helloworld.proto"], &["."])?;
33
Ok(())
44
}

rust_pajamax_bench/src/helloworld.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ mod helloworld {
1414
}
1515

1616
// define your business context
17+
#[derive(Clone)]
1718
struct MyGreeter();
1819

1920
// `Greeter` trait defines all methods in gRPC server
@@ -22,7 +23,7 @@ impl Greeter for MyGreeter {
2223
// - `fn` but not `async fn`
2324
// - `HelloRequest` but not `Request<HelloRequest>`
2425
// - `HelloReply` but not `Response<HelloReply>`
25-
fn say_hello(&self, req: HelloRequest) -> Result<HelloReply, Status> {
26+
fn say_hello(&mut self, req: HelloRequest) -> Result<HelloReply, Status> {
2627
let reply = HelloReply {
2728
response: req.request,
2829
};
@@ -39,5 +40,5 @@ fn main() {
3940
// start the server
4041
// By now we have not support configurations and multiple service,
4142
// so this API is simpler than tonic's.
42-
pajamax::serve(GreeterServer::new(greeter), addr).unwrap();
43+
pajamax::serve_local(GreeterServer::new(greeter), addr).unwrap();
4344
}

0 commit comments

Comments
 (0)