kazu-yamamoto / dns

DNS libary in Haskell
BSD 3-Clause "New" or "Revised" License
64 stars 36 forks source link

Concurrent vs sequential DNS semantics #174

Open coot opened 12 months ago

coot commented 12 months ago

We noticed the difference between concurrent & sequential semantics. When resolvConcurrent is not set, resolveSequential will loop over errors and will try to return the first non error result, but if resolveConcurrent is set resolveConcurrent will run all queries in parallel doing first-to-finish synchronisation. The difference is that if the first value is an error resolveConcurrent will return the error unlike resolveSequential.

kazu-yamamoto commented 12 months ago

dnsext, a fork of dns, provides the same semantics with an STM magic: https://github.com/kazu-yamamoto/dnsext/blob/586f42031459fdfc3e753352755d4f7af79ac1d6/dnsext-do53/DNS/Do53/Resolve.hs#L84 If you wish, I can bring it to dns.