CPU Pegged when running as a GUI
Closed this issue · 3 comments
paul-way commented
adomorn commented
same issue here
morpheums commented
The problem is that you are locking the UI thread by calling it that way from your method, there are 2 options to avoid Deadlocks, the first option you must mark your method with the "async" modifier, the second you just have to use "Task.Run":
-
Option 1 (Using the "async" method):
var serverTime = await binanceClient.GetAllPrices()
-
Option 2:
var serverTime = Task.Run(() => binanceClient.GetServerTime()).Result;
Please let me know if this worked for you so i can close the ticket, thanks!
paul-way commented
That worked perfectly for me. I figured it was something I was doing. Thanks for the quick response!