Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Nearly) Simultaneous emails aren't caught #19

Open
JConwayAWT opened this issue Jan 14, 2014 · 1 comment
Open

(Nearly) Simultaneous emails aren't caught #19

JConwayAWT opened this issue Jan 14, 2014 · 1 comment

Comments

@JConwayAWT
Copy link

I've spent a while trying to debug this and also asking around, and eventually a few people came to the conclusion that it may be an issue inside em-imap. Apologies if I'm wrong, however.

In the example posted here: http://stackoverflow.com/questions/21104289/eventmachine-not-catching-nearly-simultaneous-events/21107426 , I'm trying to catch emails as they come in and do some operation on them. This works well when separated by a few seconds, but when emails come in nearly simultaneously, only one of that group of emails will be processed. This is true even when the processing is very minimal, such as at the bottom of that post, where the program only puts the subject line.

This may be an issue with em-imap. Or it may just be that I'm new to em and using it incorrectly. If that's the issue, just let me know and I apologize for the error.

@ConradIrwin
Copy link
Owner

Hey @JConwayAWT. The current implementation of wait_for_new_emails doesn't find emails that appear while you're processing.

This is somewhat annoying to fix as IMAP is pretty complicated... We might be able to get a long way there by issuing a NOOP before the IDLE and seeing whether there are any new IDs. I'd love a pull request if you're up to it :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants