Replies: 1 comment
-
|
This is a really good suggestion. I realize that some implementations of I could pull a definition of that up to the interface too. Then there are quite a few implementations to work through, but that could be done over a longer period of time because we could keep the old overload for existing implementations too. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
This proposal suggests modifying the
AddFilemethod signature in theDiscUtilsproject to accept aFunc<Stream>instead of a directStream. This change aims to optimize resource management and the method's flexibility, especially in scenarios where theBuildmethod finalizes data writing.Detail
Currently, the
AddFilemethod accepts aStreamparameter directly, implying that the data stream must be available and open at the call time, regardless of when the writing actually occurs (via theBuildmethod). This approach can lead to resource management issues, such as streams being prematurely closed or locked due to their use in other processes before the execution ofBuild.The proposal is to change the
AddFilemethod signature to accept aFunc<Stream>. This would allow:Streamuntil just before its use, ensuring its availability and optimal condition.Streamlifecycle, aligning with reactive and functional programming principles.Previous Usage Example
Proposed Usage Example
Advantages
I appreciate your consideration of this proposal and are open to discussing any related aspects. I believe this improvement can significantly add value to
DiscUtilsproject.Thanks!
Beta Was this translation helpful? Give feedback.
All reactions