You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using Goroutines because I want to deal with many accounts as quickly as possible as part of a test suite. When I use the new SDK to call to Horizon (so far I have only tried to use SubmitTransactionXDR or AccountDetails concurrently) The code panics.
A small piece of example code that attempts to get multiple account details concurrently:
func Concurrentaccount() {
var wg sync.WaitGroup
for i := 0; i < 1000; i++ {
wg.Add(1)
go func(i int) {
defer wg.Done()
reqsource := horizonclient.AccountRequest{AccountID: testAccs[i].publickey}
source, _ := c.AccountDetail(reqsource)
fmt.Println(source)
}(i)
}
wg.Wait()
}
testAccs[i].publickey is an array of structs holding keypairs as strings.
@OwenJacob: #1276 fixed this error for my use case. It's been merged onto the master branch and will be included in the next release (1.2) of horizonclient this week.
I'm using Goroutines because I want to deal with many accounts as quickly as possible as part of a test suite. When I use the new SDK to call to Horizon (so far I have only tried to use SubmitTransactionXDR or AccountDetails concurrently) The code panics.
A small piece of example code that attempts to get multiple account details concurrently:
testAccs[i].publickey is an array of structs holding keypairs as strings.
A typical panic message:
In the depreciated Go SDK I was able to submit transactions and request account details concurrently
The text was updated successfully, but these errors were encountered: