mailio_imap_lock (mailio v0.2.0)
One session at a time on an IMAP connection. An IMAP connection has one selected mailbox, and a command such as UID STORE acts on whatever is selected when it arrives. A caller that selects a mailbox and then sends its command is safe only if nobody else selects another mailbox between the two. This lock is how callers that share one connection take turns: whoever holds it may select and send as many commands as it needs, the others wait in the order they asked. It is given up when the holder says so, when the holder dies, or when the connection does.
Summary
Functions
A lock for the connection ConnPid. It goes away with the connection.
Run Fun as the one session on the connection. Waits at most Timeout milliseconds for its turn: {error, imap_timeout} if it does not come.
Functions
A lock for the connection ConnPid. It goes away with the connection.
-spec stop(pid()) -> ok.
Run Fun as the one session on the connection. Waits at most Timeout milliseconds for its turn: {error, imap_timeout} if it does not come.