pub struct Discovery { /* fields omitted */ }
Discovery for target app address, with load balancing and fail over.
- The discovery will refresh the service list every 10 seconds by
default. The selection strategy is roundrobin, for keeping the
connections balanced.
- Once a connection to a specified host failed, discard the host and
try the next. And loop the process until find a connectable host
or the retry time reaches the max time. If all the hosts are
discarded, refresh the host list.
- The discovery also accepts an extra address pair, for fallback
when the discovery agent is down. If no backup address found, zone
will try to pick one from the discarded addresses.
Discard the given address for a period. The TTL is the one passed in the initializer.
Returns the "default value" for a type. Read more