Web Workers

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Web Workers

sjordan

It appears to me that DWR is incompatible with Web Workers, although it could probably be modified to comply with Web Worker restrictions.  Is there a version of the engine that is compatible with Web Workers?  Thx

Reply | Threaded
Open this post in threaded view
|

Re: Web Workers

david@butterdev.com
There is not a version of DWR's engine that uses Web Workers.  Can you
share your use case with us (processing large response?).

On 2015-08-17 11:17, Stan Jordan wrote:
> It appears to me that DWR is incompatible with Web Workers, although
> it could probably be modified to comply with Web Worker restrictions.
> Is there a version of the engine that is compatible with Web Workers?
> Thx
Reply | Threaded
Open this post in threaded view
|

Re: Web Workers

sjordan
Web Workers are very useful when you have a single task that takes a long time, or you have many tasks that you would like to execute concurrently.  In my case, I have many tasks that would benefit (enormously) from concurrent execution.  The problem is that I would like to make a DWR call from within my Web Worker JavaScript file, which cannot be done.  As I understand it, a Web Worker JavaScript file cannot refer to the DOM, the window object, and the document object, and one or-more of these is referenced in DWR engine.js.

Here are the details of my application.  A user selects a few CSV files from his local machine, and uploads them to my server, where I do some processing, and display results in his browser.  Some of the CSV files are large, perhaps 100 MB.  To make things go fast, the best approach is to read each CSV file with the File-API, zip each file (with JavaScript) and send zipped files to the server.  The Chrome browser will choke if you try to read a file bigger than 42 MB in a single gulp, so I am obliged to read big files in chunks and zip each chunk separately.  DWR would be useful for sending the zipped chunks to the server, but DWR calls cannot be made from inside a Web Worker JavaScript file, as mentioned above.

It would be nice if someone would develop a version of DWR engine.js that does not refer to the DOM, window object, or document object, so folks could make DWR calls from inside a Web Worker JavaScript file.

XMLHttpRequest is ok inside a Web Worker JavaScript file, so a possible workaround (in my web-app) is to abandon DWR and use XMLHttpRequest instead.  But in my mind, it would be preferable to create a special version of DWR engine.js that is compatible with Web Workers, because there are many, many applications that benefit enormously from Web-Workers, and it seems a shame to lock-out DWR from all these use-cases.
 
-----Original Message-----
From: [hidden email] [mailto:[hidden email]]
Sent: Monday, August 17, 2015 4:30 PM
To: [hidden email]
Cc: Stan Jordan <[hidden email]>
Subject: Re: [dwr-users] Web Workers

There is not a version of DWR's engine that uses Web Workers.  Can you share your use case with us (processing large response?).

On 2015-08-17 11:17, Stan Jordan wrote:
> It appears to me that DWR is incompatible with Web Workers, although
> it could probably be modified to comply with Web Worker restrictions.
> Is there a version of the engine that is compatible with Web Workers?
> Thx
Reply | Threaded
Open this post in threaded view
|

Re: Web Workers

Vojtěch Knyttl
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: how to unsubscribe (was: Web Workers)

Mike Wilson
Administrator
Reply | Threaded
Open this post in threaded view
|

Re: how to unsubscribe (was: Web Workers)

Vojtěch Knyttl
CONTENTS DELETED
The author has deleted this message.