question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Async not used correctly

See original GitHub issue

Hey, 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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:33 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jjxtracommented, Apr 20, 2018

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:

You made a new nuget package?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/jjxtra/ExchangeSharp/issues/93#issuecomment-382958609, or mute the thread https://github.com/notifications/unsubscribe-auth/ABNoGA1KjDObbQ8cIAAQjCBHjqNPYbnjks5tqVLPgaJpZM4TMs9P .

0reactions
jjxtracommented, Apr 21, 2018

It’s out there, may take a few minutes to show up. Version 0.4.0.0

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found