Merge pull request #31 from Trivernis/develop

Fix missing Send + Sync Markers on Metadata
pull/32/head
Julius Riegel 3 years ago committed by GitHub
commit 1d59661e91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

2
Cargo.lock generated

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

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

@ -32,7 +32,7 @@ async fn main() {
.build_client().await.unwrap();
// emit an initial event
let response = ctx.emit("ping", ()).await?.await_response(&ctx).await?;
let response = ctx.emit("ping", ()).await_response().await?;
}
```
@ -80,8 +80,8 @@ async fn main() {
.build_client().await.unwrap();
// emit an initial event
let response = ctx.emit_to("mainspace-server", "ping", ()).await?
.await_response(&ctx).await?;
let response = ctx.emit_to("mainspace-server", "ping", ())
.await_response().await?;
}
```

@ -164,14 +164,14 @@ impl<P: IntoPayload> EventMetadata<P> {
pub struct EmitMetadata<P: IntoPayload> {
event_metadata: Option<EventMetadata<P>>,
stream: Option<SendStream>,
fut: Option<Pin<Box<dyn Future<Output=Result<u64>> + Send>>>,
fut: Option<Pin<Box<dyn Future<Output=Result<u64>> + Send + Sync>>>,
}
/// A metadata object returned after waiting for a reply to an event
/// This object needs to be awaited for to get the actual reply
pub struct EmitMetadataWithResponse<P: IntoPayload> {
timeout: Option<Duration>,
fut: Option<Pin<Box<dyn Future<Output=Result<Event>>>>>,
fut: Option<Pin<Box<dyn Future<Output=Result<Event>> + Send + Sync>>>,
emit_metadata: Option<EmitMetadata<P>>,
}
@ -217,7 +217,7 @@ impl<P: IntoPayload> Unpin for EmitMetadata<P> {}
impl<P: IntoPayload> Unpin for EmitMetadataWithResponse<P> {}
impl<P: IntoPayload + 'static> Future for EmitMetadata<P> {
impl<P: IntoPayload + Send + Sync + 'static> Future for EmitMetadata<P> {
type Output = Result<u64>;
fn poll(mut self: Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> Poll<Self::Output> {
@ -244,7 +244,7 @@ impl<P: IntoPayload + 'static> Future for EmitMetadata<P> {
}
}
impl<P: IntoPayload + 'static> Future for EmitMetadataWithResponse<P> {
impl<P: IntoPayload + Send + Sync + 'static> Future for EmitMetadataWithResponse<P> {
type Output = Result<Event>;
fn poll(mut self: Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> Poll<Self::Output> {

Loading…
Cancel
Save