Skip to content

Commit

Permalink
example: update to match new ttrpc-compiler
Browse files Browse the repository at this point in the history
update for commit 1f2a26

Signed-off-by: Tim Zhang <[email protected]>
  • Loading branch information
Tim-Zhang committed Sep 25, 2024
1 parent 1f2a266 commit 021bef3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
4 changes: 4 additions & 0 deletions example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,7 @@ path = "./async-stream-client.rs"

[build-dependencies]
ttrpc-codegen = { path = "../ttrpc-codegen"}

[patch.crates-io]
ttrpc-compiler = { path = "/home/tim/project/ttrpc-rust/compiler"}

1 change: 0 additions & 1 deletion example/protocols/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@
#[cfg(unix)]
pub mod asynchronous;
#[cfg(unix)]
pub use asynchronous as r#async;
pub mod sync;
10 changes: 2 additions & 8 deletions example/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,8 @@ impl agent_ttrpc::AgentService for AgentService {

fn main() {
simple_logging::log_to_stderr(LevelFilter::Trace);

let h = Box::new(HealthService {}) as Box<dyn health_ttrpc::Health + Send + Sync>;
let h = Arc::new(h);
let hservice = health_ttrpc::create_health(h);

let a = Box::new(AgentService {}) as Box<dyn agent_ttrpc::AgentService + Send + Sync>;
let a = Arc::new(a);
let aservice = agent_ttrpc::create_agent_service(a);
let hservice = health_ttrpc::create_health(Arc::new(HealthService {}));
let aservice = agent_ttrpc::create_agent_service(Arc::new(AgentService {}));

utils::remove_if_sock_exist(utils::SOCK_ADDR).unwrap();
let mut server = Server::new()
Expand Down

0 comments on commit 021bef3

Please sign in to comment.