In Chapter5 we
compared the POP3 and IMAP protocols for querying remote-mail
servers. We noted that IMAP requests (unlike POP3 requests) are
tagged with a request identifier generated by the client; the server,
when it ships back a response, includes the tag of the request it
pertains to.
POP3 requests have to be processed in lockstep by both client
and server; the client sends a request, waits for the response to that
request, and only then can prepare and ship the next one. IMAP
requests, on the other hand, are are tagged so they can be overlapped.
If an IMAP client knows that it wants to fetch multiple messages, it
can stream several fetch requests (each with a different tag) to the
IMAP server, without waiting for responses between them. Responses,
each tagged, will come back when the server is ready; responses to
early requests may come in while the client is still shipping later
ones.
This strategy is general to more areas than network protocols.
If you want to cut latency, blocking or waiting on intermediate
results is deadly.
[an error occurred while processing this directive]