[QUERY] Storage Queues: Why there are no overloads that accepts CancellationToken only?
See original GitHub issueQuery/Question
Here’s the method signature for QueueClient.CreateIfNotExists()
:
public virtual Response CreateIfNotExists(Metadata metadata = default, CancellationToken cancellationToken = default) =>
What means metadata
can be null.
Then why there is no overload:
public virtual Response CreateIfNotExists(CancellationToken cancellationToken = default) =>
So I could write less chatty code:
await queueClient.CreateIfNotExists(cancellationToken);
instead of current
await queueClient.CreateIfNotExists(cancellationToken: cancellationToken);
Environment:
- Name and version of the Library package used:
Azure.Storage.Queues 12.5.0
- Hosting platform or OS and .NET runtime version:
.NET SDK (reflecting any global.json):
Version: 5.0.101
Commit: d05174dc5a
Runtime Environment:
OS Name: Windows
OS Version: 10.0.19042
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\5.0.101\
Host (useful for support):
Version: 5.0.1
Commit: b02e13abab
.NET SDKs installed:
3.0.100 [C:\Program Files\dotnet\sdk]
5.0.101 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
- IDE and version:
Microsoft Visual Studio Enterprise 2019
Version 16.8.3
VisualStudio.16.Release/16.8.3+30804.86
Microsoft .NET Framework
Version 4.8.04084
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Azure Functions: Queue Trigger is expecting Base-64 ...
Storage.Queues and found no overloads that encodes the message to Base-64 . Note that _queue is a QueueClient instance.
Read more >QueueClient.UpdateMessageAsync Method
UpdateMessageAsync(String, String, BinaryData, TimeSpan, CancellationToken). Changes a message's visibility timeout and contents.
Read more >Queues Don't Fix Overload
A queue has a perk of smoothing out the peaks which may give the illusion of fixing overload, but really you haven't added...
Read more >A Deep Dive into C#'s CancellationToken | by Mitesh Shah
Once the IsCancellationRequested property in a cancellation token is set to true , it can't be set to false again and you cant...
Read more >CANCEL QUERY
The CANCEL QUERY statement cancels a running SQL query. ... User that are not members of the admin role can cancel only their...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It might be in here - https://azure.github.io/azure-sdk/dotnet_introduction.html
This would require us to redo not just this API, but all of our APIs (across all libraries) for unpretty call for consistency. @seanmcc-msft @tg-msft Not sure if we have any SDK guidelines or suggestions that would prevent us from adding all these overloads.