Fix PooledContext not implementing Clone

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/28/head
trivernis 2 years ago
parent f189fe11f0
commit 5ab864006a
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

2
Cargo.lock generated

@ -93,7 +93,7 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bromine"
version = "0.16.0"
version = "0.16.1"
dependencies = [
"async-trait",
"bincode",

@ -1,6 +1,6 @@
[package]
name = "bromine"
version = "0.16.0"
version = "0.16.1"
authors = ["trivernis <trivernis@protonmail.com>"]
edition = "2018"
readme = "README.md"

@ -18,7 +18,7 @@ use tokio::net::TcpListener;
/// Callback ping function
async fn handle_ping(ctx: &Context, event: Event) -> Result<()> {
println!("Received ping event.");
ctx.emitter.emit_response(event.id(), "pong", ()).await?;
ctx.emit("pong", ()).await?;
Ok(())
}
@ -32,7 +32,7 @@ async fn main() {
.build_client().await.unwrap();
// emit an initial event
let response = ctx.emitter.emit("ping", ()).await?.await_response(&ctx).await?;
let response = ctx.emit("ping", ()).await?.await_response(&ctx).await?;
}
```
@ -80,7 +80,7 @@ async fn main() {
.build_client().await.unwrap();
// emit an initial event
let response = ctx.emitter.emit_to("mainspace-server", "ping", ()).await?
let response = ctx.emit_to("mainspace-server", "ping", ()).await?
.await_response(&ctx).await?;
}
```

@ -160,6 +160,7 @@ impl Context {
}
}
#[derive(Clone)]
pub struct PooledContext {
contexts: Vec<PoolGuard<Context>>,
}

Loading…
Cancel
Save