But there are no special facilities that would allow you to run some arbitrary coroutine code on webworker (like special dispatcher, similar to what you can do on JVM with threads), in theory something like this possible, but problem how to pass code to worker (again, probably it's possible to do, using some serialization, but nothing like this available now as I know), so for now you have to do that manually: write client code and worker code separately and use messages/promises to communicate between them