-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix spelling mistakes A clean error list is a happy error list * Improve string type checking There is no need to check if a string is a simple type, only to then check if its a string. Additionally, by capturing the result of the type check, we avoid the extra as (or cast) * Assume nullability of primitive types At the end of the day, what we want here is null warning suppression, but doing it with an exclamation mark can be quite hidden, and can just result in exceptions sometime later at runtime. The AssumeNotNull method is an aggressive version that throws at the site of the actual null. Also increased the language version to be able to use nameof to refer to a parameter. * Don't allow null messages The system never puts nulls in, so it was a little odd that it allowed for them to be retreived. Instead, if a message can't be retreived then the whole message may as well be null. * Use primary constructor C# 12 is nce * Remove extra logging message The BeginScope method is on ILogger, not ILogger<T>, so there was no difference between this and the method below * Use pattern matching to simplify code In particular with Nullable<T> its much nicer to use patterns, rather than .HasValue and then .Value. There is also a minor perf improvement as .Value has to check, and throw, for nulls. * Return array instead of IEnumerable Task.WhenAll returns an array, but returning it as an IEnumerable meant the GetMessageAsync method has to enumerate the results no less than 4 times! * Remove unnecessary batch size calc Mainly I wanted to remove yet another enumeration of a collection, but also because this calculation seemed useless to me. If we want to batch into chunks of 20, and there are only 10, then surely it will produce one chunk whether the batch size is set to 10 or 20. * Remove inheritdocs The IDE will automatically show the doc comments from the interface member, without needing to specify inheritdoc everywhere. Also removed some whitespace I saw while checking that no, this isn't producing a documentation file. * Tweak visibility Sealed performs better 😛 * Use CancellationToken.None This is the convention, and clearly communicates intent * Move helper methods to extension methods Default interface implementations are tempting to use as helper methods, but they are not great, as any new implementor will, at best, think they have to implement them, and at worst get compile errors. Helpers written as extension methods in the same namespace are just as discoverable, and should work regardless of implementation. * Remove unused using Must have crept in when rebasing * Specify ConfigureAwait(false) No need to force things to stay on the same thread when doing async network I/O to Azure * Get really really opinionated Why not go all out :D * Don't use collection expressions It didn't build in a codespace, so I guess this is too new. * Copy and paste doc, rather than use inherit doc, so that there are more places to update if anything changes. * Change array return to IReadOnlyList Check out how awesome patterns are! Didn't have to update any of them even though the return type now has a Count property instaed of a Length property! Yay patterns!! * Use a local for the return value
- Loading branch information
1 parent
e4956f8
commit 5167351
Showing
11 changed files
with
137 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
namespace WorldDomination.SimpleAzure.Storage.HybridQueues; | ||
|
||
public record class HybridMessage<T>(T? Content, string MessageId, string PopeReceipt, Guid? BlobId); | ||
public sealed record HybridMessage<T>(T Content, string MessageId, string PopeReceipt, Guid? BlobId); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.