-
Notifications
You must be signed in to change notification settings - Fork 310
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
Delegate updates dispatching to the backend #323
Comments
|
AFAIK, will check RFCs later:
Mailbox.Poll() is called by go-imap on NOOP with a selected mailbox. Defined in backend/: type MailboxPoller interface {
// Poll requests mailbox updates.
Poll() error
}
Server would have to find the right connection to use. This also needs to be properly synchronized to prevent races. I expect backend.Conn to be directly implemented by *server.conn (possibly with safeguards to prevent buggy backends from breaking something).
Fair point. I had a very incomplete understanding of IMAP when I started working on go-imap-sql. Need to think, though, what is actually trivial for backend to implement and what needs to have a backendutil helper. Ideas proposed in #318 can be implemented using an object called Here are considerations for SeqMapper usage. I think they should be included in documentation, because it is going to be really easy to use incorrectly and introduce subtle data-loss bugs.
|
Done in go-imap v2. |
Problem
Previous discussions:
Proposed solution
I want to propose to redesign Backend interface in a way that completely moves update handling to the backend side. This includes EXPUNGE updates buffering and sequence numbers translation. This adds additional flexibility in implementation. For example, a backend using MVCC-enabled database can rely on it to provide consistent messages view for clients. Utilities that simplify implementations of rudimentary/naive backends can be added to backendutil package.
As a starting point, here is the snippet with a bunch of Go interfaces:
Subtasks
The text was updated successfully, but these errors were encountered: