1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-01 09:24:20 -04:00
denoland-deno/cli/tests/testdata/classic_workers_event_loop.js
Luca Casonato a66218d457
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.
2021-08-18 15:19:22 +02:00

4 lines
131 B
JavaScript

new Worker(
"data:application/javascript,setTimeout(() => {console.log('done'); self.close()}, 1000)",
{ type: "classic" },
);