I noticed that batch requests were removed in 1.0. I've been using batch requests to read a folder (and recursively subfolders as well) in Google Drive to find all documents and run a drive.files.get() on each of the documents. This is only possible using the batch request (hitting too many drive.files.get at the same time didn't work), and I was wondering -- what alternatives do you guys propose to do this without using batch request?
Thanks!
+1! Would love batches. Looks like they're available in the client-side JS api: https://developers.google.com/api-client-library/javascript/features/httpbatch
As I know, batching is being deprecated internally for a better system that will enable multiple requests. It's hard to say if/when those changes will be made. Batching was experimental pre-1.0 anyway, so we have no plans to bring it back to this library. Rate-limiting would likely help this situation, though I realize that doesn't exactly give a great user experience sometimes.
Created this module as a short term alternative! https://github.com/wapisasa/Batchelor
you can also look into this https://www.npmjs.com/package/google-batch
To anyone looking for a library to do the above. google-batch is broken on the latest release. More worryingly, it relies on using the file system to edit files in other node_modules.
Very very dangerous!
@RShergold that file patching was required for preventing googleapis to send http request right away after calling any function from it.
i should have mentioned that in readme, will update that.
Most helpful comment
Created this module as a short term alternative! https://github.com/wapisasa/Batchelor