chatmail / chatmail/async-imap

Imap IDLE polling approach

Open
#55 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
147
Forks
42
Avg merge
8d 15h
Merged PRs (30d)
1

Description

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](https://github.com/async-email/async-imap/blob/master/src/extensions/idle.rs#L100) 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?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with src/extensions/idle.rs at the wait method linked in the issue, then trace how the returned futures resolve and how server messages are handled. The issue is currently a design question rather than a defined implementation task; done would require an agreed approach and a concrete scope for changing or documenting long IDLE polling.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.