Skip to content

Commit 5dfa03f

Browse files
test: make js worker queue unbounded
1 parent c285ea1 commit 5dfa03f

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

crates/core/src/host/v8/mod.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ impl JsInstanceLane {
791791
/// If the worker disappears before replying, we replace it for future
792792
/// requests but surface the disconnect to the caller instead of retrying.
793793
/// This keeps instance-lane semantics closer to the old pooled-instance
794-
/// model now that the worker queue is a rendezvous channel.
794+
/// model while still preserving one-at-a-time execution on the worker.
795795
async fn run_once<R>(
796796
&self,
797797
label: &'static str,
@@ -1038,11 +1038,10 @@ async fn spawn_instance_worker(
10381038
mut core_pinner: CorePinner,
10391039
heap_policy: V8HeapPolicyConfig,
10401040
) -> anyhow::Result<(ModuleCommon, JsInstance)> {
1041-
// Spawn a rendezvous queue for requests to the worker.
1042-
// Multiple callers can wait to hand work to the worker, but with
1043-
// `bounded(0)` there is no buffered backlog inside the channel itself.
1044-
// The worker still processes requests strictly one at a time.
1045-
let (request_tx, request_rx) = flume::bounded(0);
1041+
// Spawn an unbounded queue for requests to the worker.
1042+
// Multiple callers can enqueue work without rendezvous handoff contention,
1043+
// but the worker still processes requests strictly one at a time.
1044+
let (request_tx, request_rx) = flume::unbounded();
10461045

10471046
// This one-shot channel is used for initial startup error handling within the thread.
10481047
let (result_tx, result_rx) = oneshot::channel();

0 commit comments

Comments
 (0)