Re: [go-nuts] do i need to wait all child routine exit

2016-10-25 Thread Ken MacDonald
You should not need to wait for more than a single response if any of the responses will do the job. I've done this querying several distributed DBs for an answer, and just taking the one that comes back fastest. On Tue, Oct 25, 2016 at 2:53 AM, wrote: > in my case, i have serval child routine f

[go-nuts] do i need to wait all child routine exit

2016-10-25 Thread dkxulei
in my case, i have serval child routine for query for dns record, but i just need a answer code looks like: recvChan := make(chan *dnsRecord, 1) defer close(recvChan) for _, server := range DnsServers { go doResolve(server, req, recvChan) // query ip address }