-
-
Couldn't load subscription status.
- Fork 888
Use FileOptions.Asynchronous when doing async IO
#2488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| // Copyright (c) Six Labors. | ||
| // Copyright (c) Six Labors. | ||
| // Licensed under the Six Labors Split License. | ||
|
|
||
| namespace SixLabors.ImageSharp.IO; | ||
|
|
@@ -9,16 +9,32 @@ namespace SixLabors.ImageSharp.IO; | |
| internal interface IFileSystem | ||
| { | ||
| /// <summary> | ||
| /// Returns a readable stream as defined by the path. | ||
| /// Opens a file as defined by the path and returns it as a readable stream. | ||
| /// </summary> | ||
| /// <param name="path">Path to the file to open.</param> | ||
| /// <returns>A stream representing the file to open.</returns> | ||
| /// <returns>A stream representing the opened file.</returns> | ||
| Stream OpenRead(string path); | ||
|
|
||
| /// <summary> | ||
| /// Creates or opens a file and returns it as a writable stream as defined by the path. | ||
| /// Opens a file as defined by the path and returns it as a readable stream | ||
| /// that can be used for asynchronous reading. | ||
| /// </summary> | ||
| /// <param name="path">Path to the file to open.</param> | ||
| /// <returns>A stream representing the file to open.</returns> | ||
| /// <returns>A stream representing the opened file.</returns> | ||
| Stream OpenReadAsynchronous(string path); | ||
Neme12 marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would use Async as the suffix to match convention. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @JimBobSquarePants I agree that the Asynchronous suffix looks weird, but I didn't use the Async suffix because the method isn't actually async and doesn't return a Task or anything awaitable. Having that suffix would be misleading and would actually go against the convention. Do you really want to go against the guidelines and have an Async suffix even though the method is synchronous and can't be awaited? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah yeah, I misread the code before. Naming is fine then. I'm not that precious about it since it's internal. |
||
|
|
||
| /// <summary> | ||
| /// Creates or opens a file as defined by the path and returns it as a writable stream. | ||
| /// </summary> | ||
| /// <param name="path">Path to the file to open.</param> | ||
| /// <returns>A stream representing the opened file.</returns> | ||
| Stream Create(string path); | ||
|
|
||
| /// <summary> | ||
| /// Creates or opens a file as defined by the path and returns it as a writable stream | ||
| /// that can be used for asynchronous reading and writing. | ||
| /// </summary> | ||
| /// <param name="path">Path to the file to open.</param> | ||
| /// <returns>A stream representing the opened file.</returns> | ||
| Stream CreateAsynchronous(string path); | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.