API request WaitingForActivation “Not yet computed” error

后端 未结 2 1398
终归单人心
终归单人心 2020-12-30 14:42

I\'m using the Poloniex C# API code from: https://github.com/Jojatekok/PoloniexApi.Net

On my console application the request to get balances is working, i make the A

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-30 15:33

    This looks like a classic async-await deadlock: you have a SynchronizationContext, you await in it (which means the continuation is scheduled to that SynchronizationContext) and then you block that SynchronizationContext by calling Wait(), which leads to deadlock.

    The right solution to not block on async code, your Main should be an async method that returns a Task and awaits balance_task. Another option is to use ConfigureAwait(false) in getLatestWalletAmounts() (and any other "library" method that uses await).

提交回复
热议问题