diff options
author | Luca Casonato <hello@lcas.dev> | 2021-08-18 15:19:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-18 15:19:22 +0200 |
commit | a66218d457859fc3498db9fbc61228c74f490cc2 (patch) | |
tree | cf099a0d7cfaeb5e6c10d55473bfc0b4ceb9c8d9 /cli/tests/testdata | |
parent | 480cfda8d5a5560fe0cc3ac2d9a3b798bf23f060 (diff) |
fix(runtime): event loop panics in classic workers (#11756)
Classic worker scripts are now executed in the context of a Tokio
runtime. This does mean we can not spawn more tokio runtimes in
"op_worker_sync_fetch". We instead spawn a new thread there, that can
create a new Tokio runtime that we can use to block the worker thread.
Diffstat (limited to 'cli/tests/testdata')
-rw-r--r-- | cli/tests/testdata/classic_workers_event_loop.js | 4 | ||||
-rw-r--r-- | cli/tests/testdata/classic_workers_event_loop.js.out | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/cli/tests/testdata/classic_workers_event_loop.js b/cli/tests/testdata/classic_workers_event_loop.js new file mode 100644 index 000000000..810a6df7f --- /dev/null +++ b/cli/tests/testdata/classic_workers_event_loop.js @@ -0,0 +1,4 @@ +new Worker( + "data:application/javascript,setTimeout(() => {console.log('done'); self.close()}, 1000)", + { type: "classic" }, +); diff --git a/cli/tests/testdata/classic_workers_event_loop.js.out b/cli/tests/testdata/classic_workers_event_loop.js.out new file mode 100644 index 000000000..19f86f493 --- /dev/null +++ b/cli/tests/testdata/classic_workers_event_loop.js.out @@ -0,0 +1 @@ +done |