Skip to content

Imap IDLE polling approach #55

@blelump

Description

@blelump

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions