On Wednesday, August 26, 2015 at 1:29:38 PM UTC+2, Daniel Kersten wrote:

> 
> If you can use newer browser, you've got Transferrable Object to transfer 
> binary data with zero-copy.
>  

True but I was talking about CLJS data which isn't binary.

> 
> Agreed, its probably a bit of work. I guess that since each one has its own 
> JS context, the simplest way is probably to have two cljs projects: your main 
> code and your web worker code.
> 

Actually you want to use closure modules so some code can be shared. With 2 
projects the client will download 2 separate instances of cljs.core which is 
quite heavy.

I have an example here:
https://github.com/thheller/shadow-build/tree/master/cljs-data/workers/src
https://github.com/thheller/shadow-build/blob/master/dev/build.clj#L6-L30

It is not a good example but the idea is to have one common module (cljs) and 
one for each "client" (ie. the page itself, worker1 and worker). worker1 (and 
2) will automatically load the cljs module which the browser already has 
available because the page did already load it.

But this is going too far off-topic. If anyone is actually interested in using 
WebWorkers I'd be happy to go into further detail on how that works in 
shadow-build.

Cheers,
/thomas

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to