Apps Script is inherently synchronous - you cant do lots of things at once. Primarily to get round the execution limit, I did a science project using triggers for parallel processing but the triggers are fairly unpredictable in when they get round to executing.HTMLservice allows you to run JavaScript on the client, and you can also run Apps Scripts from within the HTML service. So the question is whether they will run asynchronously, each with a separate quota, and whether I can manage to get this working within the confines of caja. The answer is YES and YES and YES! There's a new and improved version of this over on Orchestration of Apps Scripts - parallel threads and defeating quotas Demo exampleHere's a quick 15 second video of simple map/reduce exercise of 3 map tasks in parallel followed by a reduce of the results. Here's what a completed progress sidebar looks like. Note that each task shows how long it took to complete - This example shows that we got 23 seconds of compute time done in 10 seconds through parallel running. All the bars are green so nothing failed. You'll notice the bars changing colors at different stages of execution.For more on this see
For more snippets like this see Google Apps Scripts snippetsFor help and more information join our forum,follow the blog or follow me on twitter .
|
Services > Desktop Liberation - the definitive resource for Google Apps Script and Microsoft Office automation > Google Apps Script HTML service >
Running things in parallel using HTML service
Subpages (10):
Dealing with rate limited services
Parallel implementation and getting started
Running GmailApp in parallel
Running parallel tasks as a web app
Running things in parallel that need oAUTH2 - datastore
Simulating multiuser testing
Some hints on setting up parallel running profiles
Testing locking and transactions
Testing parallel processing inline
Using GmailApp in parallel processes
Comments