mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
fix(runtime/web_worker): Use biased select when getting module result (#14553)
This commit is contained in:
parent
2f7f41533b
commit
cb884de2e9
6 changed files with 28 additions and 3 deletions
|
@ -557,6 +557,8 @@ impl WebWorker {
|
|||
let id = self.preload_module(module_specifier, false).await?;
|
||||
let mut receiver = self.js_runtime.mod_evaluate(id);
|
||||
tokio::select! {
|
||||
biased;
|
||||
|
||||
maybe_result = &mut receiver => {
|
||||
debug!("received module evaluate {:#?}", maybe_result);
|
||||
maybe_result.expect("Module evaluation result not provided.")
|
||||
|
@ -579,6 +581,8 @@ impl WebWorker {
|
|||
) -> Result<(), AnyError> {
|
||||
let mut receiver = self.js_runtime.mod_evaluate(id);
|
||||
tokio::select! {
|
||||
biased;
|
||||
|
||||
maybe_result = &mut receiver => {
|
||||
debug!("received worker module evaluate {:#?}", maybe_result);
|
||||
// If `None` is returned it means that runtime was destroyed before
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue