Skip to content

Commit

Permalink
Clarify how to deal with async client methods in contributiong docs (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomas-pajurek authored Aug 12, 2024
1 parent ef0ada4 commit 42015f0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
changelog:
exclude:
labels:
- contributing-documentation
12 changes: 9 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,17 @@ All new features and changes must be reflected in the documentation [README.md](

#### Supported client methods & properties

* All supported methods must also support their async counterparts if they exist in the real client.
* All supported methods must be truly async (currently, this is mostly ensured by calling `Task.Yield()` at the start of each method).
* If a supported method accepts a parameter that is related to a unsupported feature, the parameter should be ignored and the should not fail because of it.
* If a supported method accepts a parameter that is related to a unsupported feature, the parameter should be ignored and the method call should not fail because of it. Such unsupported feature should be explicitly documented in the table of supported and unsupported features.
* No supported method should not return dummy constant value. Instead, they should return a value that reflects the current state of the in-memory provider.

##### Async methods

* All supported methods must also support their async counterparts if they exist in the real client.
* All supported methods must be truly async (currently, this is mostly ensured by calling `Task.Yield()` at the start of each method).
* The `Task.Yield()` should be present as soon as in the callstack as possible.
* Do not use `ConfigureAwait(ConfigureAwaitOptions.ForceYielding)` instead for consistency sake.
* `ConfigureAwait(false)` or `ConfigureAwait(ConfigureAwaitOptions.None)` are not used. The problems associated with this decision are considered insignificant for this library.

#### Unsupported client methods & properties

* All unsupported methods should be explicitly overwritten and throw `NotSupportedException` exception. This way, user is not exposed to confusing behavior coming from inherited real clients which are (by design) not properly configured.
Expand Down

0 comments on commit 42015f0

Please sign in to comment.