title: Gmail push notifications in Rails
body: <p>I am developing an application where users add their Gmail accounts, and I do some classification work on their emails.</p>
  
  <p>I want to be notified when a new email comes to any of the registered accounts.</p>
  
  <p>A solution is to keep polling the accounts via IMAP and saving the last email date I have fetched to check whether there is a new mail or not, but this has a lot of overhead.</p>
  
  <p>Any idea how to monitor Gmail and be notified when a new email is received and integrate this with a Rails app? Is there an extension which can do that and send a post request to my Rails application for example?</p>