Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade async-channel #4358

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ resolver = "2"
[workspace.dependencies]
adaptive_backoff = "0.2.1"
anyhow = "1.0.86"
async-channel = { version = "1.9.0", default-features = false }
async-channel = { version = "2.3.1", default-features = false }
async-io = "2.3.3"
async-lock = "3.4.0"
async-std = { version = "1.8.0", default-features = false }
Expand Down Expand Up @@ -192,7 +192,7 @@ fluvio-smartmodule = { version = "0.8.0", path = "crates/fluvio-smartmodule", de
fluvio-socket = { version = "0.15.1", path = "crates/fluvio-socket", default-features = false }
fluvio-spu-schema = { version = "0.17.0", path = "crates/fluvio-spu-schema", default-features = false }
fluvio-storage = { path = "crates/fluvio-storage" }
fluvio-stream-dispatcher = { version = "0.13.2", path = "crates/fluvio-stream-dispatcher" }
fluvio-stream-dispatcher = { version = "0.13.3", path = "crates/fluvio-stream-dispatcher" }
fluvio-stream-model = { version = "0.11.4", path = "crates/fluvio-stream-model", default-features = false }
fluvio-types = { version = "0.5.0", path = "crates/fluvio-types", default-features = false }
fluvio-kv-storage = { path = "crates/fluvio-kv-storage", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion crates/fluvio-cli/src/client/consume/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ mod cmd {
let mut stream = fluvio
.consumer_with_config(consume_config)
.await?
.take_until(stop_signal.recv());
.take_until(stop_signal.recv().boxed());
self.consume_records_stream(&mut stream, tableformat)
.await?;

Expand Down
2 changes: 1 addition & 1 deletion crates/fluvio-sc/src/controllers/mirroring/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl<C: MetadataItem> RemoteMirrorController<C> {
if let Some((home, _)) = self.get_mirror_home_cluster().await {
info!(home = %home.id, "connected to home cluster");
let home_config = self.build_home_client(&home).await?;
let mut stream = self.request_stream(&home, home_config).await?;
let mut stream = self.request_stream(&home, home_config).await?.boxed();

info!("created request stream");

Expand Down
2 changes: 1 addition & 1 deletion crates/fluvio-stream-dispatcher/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "fluvio-stream-dispatcher"
edition = "2021"
version = "0.13.7"
version = "0.13.8"
authors = ["Fluvio Contributors <[email protected]>"]
description = "Fluvio Event Stream access"
repository = "https://github.com/infinyon/fluvio"
Expand Down
30 changes: 16 additions & 14 deletions crates/fluvio/src/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,21 +349,23 @@ impl FluvioAdmin {
debug!(api_version = req_msg.header.api_version(), obj = %S::LABEL, "create watch stream");
let inner_socket = self.socket.new_socket();
let stream = inner_socket.create_stream(req_msg, 10).await?;
Ok(stream.map(|respons_result| match respons_result {
Ok(response) => {
let watch_response = response.downcast().map_err(|err| {
IoError::new(ErrorKind::Other, format!("downcast error: {:#?}", err))
})?;
watch_response.ok_or(IoError::new(
Ok(stream
.map(|respons_result| match respons_result {
Ok(response) => {
let watch_response = response.downcast().map_err(|err| {
IoError::new(ErrorKind::Other, format!("downcast error: {:#?}", err))
})?;
watch_response.ok_or(IoError::new(
ErrorKind::Other,
format!("cannot decoded as {s}", s = S::LABEL),
))
}
Err(err) => Err(IoError::new(
ErrorKind::Other,
format!("cannot decoded as {s}", s = S::LABEL),
))
}
Err(err) => Err(IoError::new(
ErrorKind::Other,
format!("socket error {err}"),
)),
}))
format!("socket error {err}"),
)),
})
.boxed())
}
}

Expand Down
9 changes: 5 additions & 4 deletions crates/fluvio/src/consumer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,10 +384,11 @@ where
warn!("SPU does not support Offset Management API");
}

let mut stream = self
.pool
.create_stream_with_version(&replica, stream_request, stream_fetch_version)
.await?;
let mut stream = StreamExt::boxed(
self.pool
.create_stream_with_version(&replica, stream_request, stream_fetch_version)
.await?,
);

let (server_sender, server_recv) =
async_channel::bounded::<StreamToServer>(STREAM_TO_SERVER_CHANNEL_SIZE);
Expand Down
3 changes: 2 additions & 1 deletion crates/fluvio/src/consumer/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ impl<T: Stream<Item = Result<Record, ErrorCode>> + Unpin> Stream
}
}

impl<T> ConsumerStream for futures_util::stream::TakeUntil<T, async_channel::Recv<'_, ()>>
impl<T> ConsumerStream
for futures_util::stream::TakeUntil<T, BoxFuture<'_, async_channel::Recv<'_, ()>>>
where
T: ConsumerStream,
{
Expand Down
6 changes: 4 additions & 2 deletions crates/fluvio/src/sync/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,18 @@ where
}

#[instrument(
skip(self,response),
skip(self,async_response),
fields(
spec = S::LABEL,
)
)]
async fn dispatch_loop(mut self, mut response: AsyncResponse<ObjectApiWatchRequest>) {
async fn dispatch_loop(mut self, async_response: AsyncResponse<ObjectApiWatchRequest>) {
use tokio::select;

debug!("{} starting dispatch loop", S::LABEL);

let mut response = async_response.boxed();

loop {
// check if shutdown is set
if self.shutdown.is_set() {
Expand Down
4 changes: 2 additions & 2 deletions crates/fluvio/src/sync/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ mod context {
mod unstable {
use super::*;
use crate::metadata::store::MetadataChanges;
use futures_util::Stream;
use futures_util::{Stream, StreamExt};

impl<S> StoreContext<S>
where
Expand All @@ -193,7 +193,7 @@ mod context {
}
});

receiver
receiver.boxed()
}
}
}
Expand Down
Loading