python - Long polling with GMail API -


I am creating an installation that lasts for several days and in real time to receive notifications from Gmail inbox Required I Gmail API is great for many needs, so I want to use it. However, there is no IDLE command like IMAP

I have just created a GML API that selects the mailbox every few seconds. It works great, but after a while the time (I get "reset connection by peer"). So is it appropriate to shut down the session and start it every half hour or to resume it (like with IWL)? Is this a terrible, horrible hack, which will annoy my door in the middle of the night?

Should the proper solution be entered with IMAP and to use the IDEL to inform my Gmail API module to start and when they drag into the changes that occur? Or should I just suck it out and implement an IMAP only?

Certainly not IMAP, this real time even with IMAP idle command It just voted a few (5?) Seconds and covered the cover and then pressures for the connection. (Use yourself and see the delay there.)

history.list Inquiry () is often quite cheap and should be fine. If it is for a lot of users, then you want to adapt a bit like an intelligent backup to the inactive mailbox (like there is no update for every two minutes or two minutes for an additional maximum of 5 seconds each)?

Google will definitely not weaken your door, or it will probably notice unless you are doing it every second with 1M users. :)

The real push notification for the API is definitely something that is called for.

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -