Skip to content

Commit

Permalink
grpc comment
Browse files Browse the repository at this point in the history
  • Loading branch information
youngday committed Jun 16, 2024
1 parent 2e120c3 commit 18da472
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 20 deletions.
21 changes: 11 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,14 @@ path = "examples/quic/client.rs"
name = "quic_server"
path = "examples/quic/server.rs"

[[example]]
name = "grpc-client"
path = "examples/grpc_poem/helloworld/src/client.rs"

[[example]]
name = "grpc-server"
path = "examples/grpc_poem/helloworld/src/server.rs"
[[example]]
name = "grpc-jsoncodec-server"
path = "examples/grpc_poem/jsoncodec/src/server.rs"
# please uncomment for grpc
# [[example]]
# name = "grpc-client"
# path = "examples/grpc_poem/helloworld/src/client.rs"

# [[example]]
# name = "grpc-server"
# path = "examples/grpc_poem/helloworld/src/server.rs"
# [[example]]
# name = "grpc-jsoncodec-server"
# path = "examples/grpc_poem/jsoncodec/src/server.rs"
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
|zenoh_pub,zenoh_sub|pub sub|pub sub|
|ice_pub,ice_sub|pub sub|pub sub|
|discovery|iceoryx2 discovery| |
|grpc-client,grpc-server,grpc-jsoncodec-server|poem grpc examples ,with json codec | easy genarate proto |
|grpc-client,grpc-server,grpc-jsoncodec-server|poem grpc examples ,with json codec |⚠️
// please uncomment for grpc |
|ws_client,ws_server| | websocket |
|quic_server,quic_client|quic,http3|quic,http3|
## vscode build
Expand Down Expand Up @@ -77,4 +78,11 @@ but not c++ and python app,now are planning,waiting for release
cargo run --example quic_server ./

cargo run --example quic_client https://localhost:4433/Cargo.toml
```
```

## grpc

for building proto not work on github workflow,

⚠️ // please uncomment for grpc

17 changes: 9 additions & 8 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
use std::io::Result;
// please uncomment for grpc
// use std::io::Result;

use poem_grpc_build::Config;
// use poem_grpc_build::Config;

fn main() -> Result<()> {
Config::new()
.codec("::poem_grpc::codec::JsonCodec")
.type_attribute(".", "#[derive(serde::Deserialize, serde::Serialize)]")
.compile(&["./proto/helloworld.proto"], &["./proto"])
}
// fn main() -> Result<()> {
// Config::new()
// .codec("::poem_grpc::codec::JsonCodec")
// .type_attribute(".", "#[derive(serde::Deserialize, serde::Serialize)]")
// .compile(&["./proto/helloworld.proto"], &["./proto"])
// }

0 comments on commit 18da472

Please sign in to comment.