Provide callers a way to write directly to tmp/ - #46
Conversation
Some callers may want to stream bytes into a new mail file directly vs. buffering the entire message blob in memory. To do so, provide a way to return a handle to a file in the maildir tmp/ while allowing cleanup when the handle goes out of scope if it hasn't been renamed into cur/ or new/.
5fc859d to
224f4d4
Compare
|
Based on your stated intent of allowing callers to stream bytes, I made an alternate PR at #48. Would that solve your problem? The idea is that you pass in a Read impl which can provide the bytes on-demand instead of having to buffer them in memory. |
|
Unfortunately, that doesn't work for my use case. I'm Additionally, the The |
|
Ok, sorry for the delay. After looking at this again I think it's a good addition. Merging! |
Some callers may want to stream bytes into a new mail file directly vs. buffering the entire message blob in memory. To do so, provide a way to return a handle to a file in the maildir tmp/ while allowing cleanup when the handle goes out of scope if it hasn't been renamed into cur/ or new/.