Esempio n. 1
0
// ConfigTimeout Keys:
//	PollTimeout
//	ConnectTimeout
//	RetryTimeout
//
// timeout should of type time.Duration
func (client *Client) ConfigTimeout(cCfgKey C.config_options_t, timeout time.Duration) {
	client.lock()
	defer client.unlock()
	var cTimeout C.int
	if cCfgKey == C.CFG_RETRY_TIMEOUT {
		cTimeout = C.int(timeout / time.Second)
	} else {
		cTimeout = C.int(timeout / time.Microsecond)
	}
	C.client_config(client._imp, cCfgKey, cTimeout)
}
Esempio n. 2
0
func (client *Client) configHashFunction(val int) {
	client.lock()
	defer client.unlock()

	C.client_config(client._imp, C.CFG_HASH_FUNCTION, C.int(val))
}