gogol icon indicating copy to clipboard operation
gogol copied to clipboard

Support for batching requests

Open agrue opened this issue 5 years ago • 0 comments

Some Google APIs support a batch endpoint that lets you combine multiple API calls into a single HTTP request. The specific one I'm interested in is Gmail (https://developers.google.com/gmail/api/guides/batch) though others support it too (e.g. Drive: https://developers.google.com/drive/api/v3/batch)

AFAICT the library doesn't currently support this. I've started taking a look at this myself; the sort of API I have in mind would automatically give you the instance GoogleRequest a => GoogleRequest (Batch a) (with Batch a being some kind of wrapper over multiple a). But the current implementation doesn't support this easily; to give one example, the response parsers in GClient can't be easily combined into a batch parser because they consume all their input.

Anyway, I'm sure this is possible with enough work, but I thought I should post about it here in case you have your own ideas about how to do this. Cheers!

agrue avatar Apr 27 '19 21:04 agrue