Async not used correctly
See original GitHub issueHey, I am the main dev of https://github.com/btcpayserver/btcpayserver a self hosted payment server which run your own node and support multiple shitcoin on top of bitcoin.
I want to use your API to provide “auto dumping” feature to merchants.
However, it seems that you are using async incorrectly by wrapping sync call with Task.Run.
What you should do is the reverse, using async/await all along the way and use YourMethodAsync().GetAwaiter().GetResult()
to make synchronous calls methods.
If I propose a PR fixing all of this, will you merge?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:33 (2 by maintainers)
Top Results From Across the Web
Async Await not returning value as expected
You're not quite using it properly. Every async function returns a Promise but if you don't have an explicit return statement, ...
Read more >Common async / Task mistakes, and how to avoid them
Common async / Task mistakes, and how to avoid them · UnobservedTaskExceptions from async Task methods · Properly awaiting concurrent Tasks · Async ......
Read more >Async/Await - Best Practices in Asynchronous Programming
Async void methods have different composing semantics. Async methods returning Task or Task<T> can be easily composed using await, Task.WhenAny, Task.WhenAll ...
Read more >Long Story Short: Async/Await Best Practices in .NET
Async void is a big no-no. As a rule of thumb consider using async Task instead of async void. ... There are several...
Read more >Two Ways to Do Async/Await in ASP.NET Wrong (and How ...
If await is not used in the body of an async method, the C# compiler will generate a warning, but the code will...
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
Replacing my cpu cooler. Pump died after 4 months 😦 Will make a package tomorrow!
– Jeff
On Thu, Apr 19, 2018 at 9:15 PM, Nicolas Dorier notifications@github.com wrote:
It’s out there, may take a few minutes to show up. Version 0.4.0.0