Ejemplo n.º 1
0
func NewAsyncConnectionMode(
	clients []mode.AsyncProtocolClient,
	s Settings,
) (mode.ConnectionMode, error) {
	if s.Failover {
		clients = NewAsyncFailoverClient(clients)
	}
	return lb.NewAsync(clients, s.MaxAttempts, s.WaitRetry, s.Timeout, s.MaxWaitRetry)
}
Ejemplo n.º 2
0
func NewAsyncConnectionMode(
	clients []mode.AsyncProtocolClient,
	failover bool,
	maxAttempts int,
	waitRetry, timeout, maxWaitRetry time.Duration,
) (mode.ConnectionMode, error) {
	if failover {
		clients = NewAsyncFailoverClient(clients)
	}
	return lb.NewAsync(clients, maxAttempts, waitRetry, timeout, maxWaitRetry)
}