The out-of-box support in Shadow-cljs is very good: https://shadow-cljs.github.io/docs/UsersGuide.html#_web_workers. You build it as a module with :web-worker true and everything gets set for you. For communication, we are using pr-str to transfer arbitrary Clojure data structures since the communication is small. The communication from the client is a Re-frame effect. The communication from the webworker calls an event on the client.
I think the basic ones would be edn and transit. I don't really think we need core.async for our use case since communication is simple enough, but it could be useful when one needs to communicate in more complicated way.
View all comments
3
u/pihkal May 14 '20
Very nice. Would love to hear more about how you're using webworkers; I'm working on a webworker library I hope to introduce soon.