zoellner / gmail-batch-stream Goto Github PK
View Code? Open in Web Editor NEWStreaming interface to Gmail API using batch requests
License: MIT License
Streaming interface to Gmail API using batch requests
License: MIT License
For whatever reason, the pseudo gmail client returned promises, causing havoc in this library.
In the end, I had to change the usage example to resolve promises using .flatMap(_h)
before piping to gbs:
.flatMap(_h) // resolve promises
.pipe(this.googleBatchStream.pipeline(1, 5))
and
.flatMap(_h) // resolve promises
.pipe(GBS.pipeline(100, 5)) //Run in batches of 100. Use quota of 5 (for users.messages.get).
To fix this, add to multipart: batch.map((request, index) => {
:
request.qs = request.qs || { };
request.json = request.json || { } ;
Hi @zoellner ,
I'm using the library and find it exactly suitable to my need.
However, i'm getting the above error despite using it.
Can you help?
Currently there is one rate limiter per GBS. in some cases however, one might need to run several operations for one user in a stream (e.g. list messages then get messages).
A rate limiter per user, created outside the GBS, would be needed in this case.
After employing gmail-batch-stream, the node process does not exit at the end, despite the stream being consumed fully (using done() or toArray()).
Cause: When a 404 response is encountered, the body is not JSON, but plain text.
HTTP/1.1 404 Not Found
Content-Type: text/html; charset=UTF-8
Date: Thu, 13 Dec 2018 22:36:43 GMT
Expires: Thu, 13 Dec 2018 22:36:43 GMT
Cache-Control: private, max-age=0
Content-Length: 9
Not Found
This is a great addition to the world of open source! Thanks!
However, with highland.js at 3k stars and rxjs at 16k stars, rxjs seems to have a wider adoption than highland.js. Is this library using any highland.js-specific features? If not, is supporting RxJS an option?
I tried it out but ran into many issues (will report them separately as soon as I get some idea if they are all the same issue or several different ones), suspecting that this library does not support Node v10 (or something else relevant to my setup).
Adding some basic tests would allow me to verify if the code runs as expected in my environment.
Some inspiration:
https://github.com/SpiderStrategies/node-gmail-api/tree/master/test (including tests for batch requests using nock)
https://github.com/fedecia/gmail-api-sync/tree/master/test (includes helper scripts to generate access tokens)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.