Right now, each Email maintains a list of Attachment. This reduces parallelism, as all attachments need to be download before processing can occur.
Proposed Solution
Idea: make Attachment point to a copy of the Email. Handle Email processing if needed (e.g., scrapbook), and handle each Attachment separately. We can also just take relevant fields from the Email (sender + recipient?).
We then modify the "handler" APIs to take in either an Email or an Attachment for processing.
Also, let us add a trait on Attachment for fetching.
Benefits
Attachment fetching and uploading can happen independently, thereby improving parallelism.
Problem
Right now, each
Email
maintains a list ofAttachment
. This reduces parallelism, as all attachments need to be download before processing can occur.Proposed Solution
Idea: make
Attachment
point to a copy of theEmail
. HandleEmail
processing if needed (e.g., scrapbook), and handle eachAttachment
separately. We can also just take relevant fields from theEmail
(sender + recipient?).We then modify the "handler" APIs to take in either an
Email
or anAttachment
for processing.Also, let us add a trait on
Attachment
for fetching.Benefits
Attachment fetching and uploading can happen independently, thereby improving parallelism.