Skip to content

Commit

Permalink
use bounded channel w/ blocking send
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewgazelka committed Nov 20, 2024
1 parent b837f49 commit e18514c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/daft-connect/src/op/execute/root.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl Session {

let finished = context.finished();

let (tx, rx) = tokio::sync::mpsc::unbounded_channel::<eyre::Result<ExecutePlanResponse>>();
let (tx, rx) = tokio::sync::mpsc::channel::<eyre::Result<ExecutePlanResponse>>(16);
std::thread::spawn(move || {
let result = (|| -> eyre::Result<()> {
let plan = translation::to_logical_plan(command)?;
Expand All @@ -50,14 +50,14 @@ impl Session {

for table in tables.as_slice() {
let response = context.gen_response(table)?;
tx.send(Ok(response)).unwrap();
tx.blocking_send(Ok(response)).unwrap();
}
}
Ok(())
})();

if let Err(e) = result {
tx.send(Err(e)).unwrap();
tx.blocking_send(Err(e)).unwrap();
}
});

Expand Down

0 comments on commit e18514c

Please sign in to comment.