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

Use TX executor for multicast TX #626

Merged
Merged
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
7 changes: 5 additions & 2 deletions io/zenoh-transport/src/multicast/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ use crate::{
priority::TransportPriorityTx,
},
multicast::transport::TransportMulticastInner,
TransportExecutor,
};
use async_executor::Task;
use async_std::{
prelude::FutureExt,
task::{self, JoinHandle},
Expand Down Expand Up @@ -269,7 +271,7 @@ pub(super) struct TransportLinkMulticastUniversal {
// The transport this link is associated to
transport: TransportMulticastInner,
// The signals to stop TX/RX tasks
handle_tx: Option<Arc<JoinHandle<()>>>,
handle_tx: Option<Arc<Task<()>>>,
signal_rx: Signal,
handle_rx: Option<Arc<JoinHandle<()>>>,
}
Expand All @@ -295,6 +297,7 @@ impl TransportLinkMulticastUniversal {
&mut self,
config: TransportLinkMulticastConfigUniversal,
priority_tx: Arc<[TransportPriorityTx]>,
executor: &TransportExecutor,
) {
let initial_sns: Vec<PrioritySn> = priority_tx
.iter()
Expand Down Expand Up @@ -331,7 +334,7 @@ impl TransportLinkMulticastUniversal {
// Spawn the TX task
let c_link = self.link.clone();
let ctransport = self.transport.clone();
let handle = task::spawn(async move {
let handle = executor.spawn(async move {
let res = tx_task(
consumer,
c_link.tx(),
Expand Down
2 changes: 1 addition & 1 deletion io/zenoh-transport/src/multicast/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ impl TransportMulticastInner {
sn_resolution: self.manager.config.resolution.get(Field::FrameSN),
batch_size,
};
l.start_tx(config, self.priority_tx.clone());
l.start_tx(config, self.priority_tx.clone(), &self.manager.tx_executor);
Ok(())
}
None => {
Expand Down
Loading