dermesser / async-google-apis

Generate Asynchronous Google API stubs for Rust!
MIT License
22 stars 12 forks source link

Ferature Request: Add support for Batch Requests #5

Open chrisabruce opened 3 years ago

chrisabruce commented 3 years ago

As documented here: https://developers.google.com/gmail/api/guides/batch it would be ideal to also add support for batch requests.

dermesser commented 3 years ago

This is something I overlooked in the first iteration to gain simplicity (we now have three or four request methods used for all calls). This probably needs a way to represent requests as objects that can be sent one-at-a-time or multiple at once by a call.

dermesser commented 3 years ago

I was wondering here - with async operations, is there a big difference between sending batch requests in the first place and sending several requests at once, and join!ing/join_alling them? And given that the batch interface is usually "concatenate raw HTTP requests into a multipart/mixed body", which brings considerable complexity into the picture, this may actually be not that bad as an alternative (caveat: as long as hyper does this the way I hope it does, i.e. using HTTP/2 as it is intended to be used, with concurrent streams etc.)

It shouldn't make a big difference in terms of quota, or transferred data volume, while keeping the logic much more simple. What am I missing?