1. If the host doesn't support IPv6 (or supports only IPv6), allow the client to resolve IPs
2. Do not re-create a resolver in the hot path every time, but only if there's an error
3. Better concurrency handling with picking an address from the list via round-robin
4. Use one less background goroutine
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
* add waiter pool for first browse
Signed-off-by: Joni Collinge <jonathancollinge@live.com>
* remove waiter
Signed-off-by: Joni Collinge <jonathancollinge@live.com>
* fix up refresh channel and test
Signed-off-by: Joni Collinge <jonathancollinge@live.com>
* add more tests
Signed-off-by: Joni Collinge <jonathancollinge@live.com>
* update comments
Signed-off-by: Joni Collinge <jonathancollinge@live.com>
* push to done chan on early error
Signed-off-by: Joni Collinge <jonathancollinge@live.com>
* add closer and stop goroutine leaks in tests
Signed-off-by: Joni Collinge <jonathancollinge@live.com>
* go mod tidy
Signed-off-by: Joni Collinge <jonathancollinge@live.com>
* increase make test timeout
Signed-off-by: Joni Collinge <jonathancollinge@live.com>
* provide fallback if subscriber never receives from chans
Signed-off-by: Joni Collinge <jonathancollinge@live.com>
* use counter for sub id and drain results on context done
Signed-off-by: Joni Collinge <jonathancollinge@live.com>
* reduce concurrent test iterations to 1000
Signed-off-by: Joni Collinge <jonathancollinge@live.com>
* add comment to explain expected behaviour
Signed-off-by: Joni Collinge <jonathancollinge@live.com>
* do not remove subscribers, clear them at the end
Signed-off-by: Joni Collinge <jonathancollinge@live.com>
* update outdated comment
Signed-off-by: Joni Collinge <jonathancollinge@live.com>
* reduce concurrent test iterations to 1000
Signed-off-by: Joni Collinge <jonathancollinge@live.com>
* run cleanup in background
Signed-off-by: Joni Collinge <jonathancollinge@live.com>
* reduce concurrent test iterations to 100
Signed-off-by: Joni Collinge <jonathancollinge@live.com>
* update comment to explain cache recheck better
Signed-off-by: Joni Collinge <jonathancollinge@live.com>
Co-authored-by: Looong Dai <long.dai@intel.com>
* remove benchmark
* explicitly use zero value
* initialize slice to 0 len
* fix loop closure
* use basic int for counter
* reduce diff
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
* WIP mdns rr
* add callback mechanism
* add initial testing
* fix lint
* add debug logs
* register as unique instance
* update comments
* add continue when no address
* fix lint
* add test for empty address list next
* refresh on new app id in the background
* fix lint
* update comment
* add way to control mDNS instance ID
* update test case
* add guard for empty refreshes
* update log message to include app id
* update log message to include app id
* update comment
Co-authored-by: Yaron Schneider <yaronsc@microsoft.com>