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

Imap IDLE polling approach #55

Open
blelump opened this issue Jan 12, 2022 · 0 comments
Open

Imap IDLE polling approach #55

blelump opened this issue Jan 12, 2022 · 0 comments

Comments

@blelump
Copy link

blelump commented Jan 12, 2022

Hi,

this is more a question than an issue itself. The current IDLE implementation is designed in a way that the future resolves for anything that comes from the server. I am wondering then what would be best approach for long IDLE polling, where client listens continuously for any change from the server side. I was thinking of a loop:

        loop {
            let (idle_wait, _interrupt) = idle.wait();
            let idle_result = idle_wait.await.unwrap();
            match idle_result {
               ...
            };
        }

The above approach calls #wait each time and apart from that, there's a tiny possibility to miss server message when the current future is resolved and the execution is in the match statement. What would be best approach to tackle that?

@blelump blelump changed the title Long IDLE polling approach Imap IDLE polling approach Jan 12, 2022
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

1 participant