Configuring Timeouts | Ruby API Client V1 (Deprecated)
This version of the Ruby API client has been deprecated in favor of the latest version of the Ruby API client.
Algolia::Client.new({ application_id: 'YourApplicationID', api_key: 'YourAdminAPIKey', connect_timeout: Integer connectTimeout, send_timeout: Integer requestTimeout, receive_timeout: Integer readTimeout, batch_timeout: Integer searchBatchTimeout, search_timeout: Integer searchReadTimeout })
About this method
Override the pre-configured timeouts.
Network & DNS resolution can be slow. That is why we have pre-configured timeouts. We do not advise to change them, but it could make sense to change them in some special cases.
Note: Not all parameters are available for every language. See Parameters below.
Examples
1
2
3
4
5
6
$config = SearchConfig::create('YourApplicationID', 'YourAdminAPIKey');
$config->setConnectTimeout(2); // connection timeout in seconds
$config->setReadTimeout(30); // read timeout in seconds
$config->setWriteTimeout(30); // write timeout in seconds
SearchClient::createWithConfig($config);
Parameters
connectTimeout
|
type: integer
default: differs per client, see defaults below
Optional
Timeout for the TCP session to connect. Note: Available in all languages except Swift, C#, and Kotlin. Default values:
|
readTimeout
|
type: integer
default: differs per client, see defaults below
Optional
Timeout for the read on the TCP socket. Default values:
|
writeTimeout
|
type: integer
default: differs per client, see defaults below
Optional
Same as requestTimeout, but applies only to write operations. Note: Available in all languages except Android and Scala. Default values:
|
hostDownDelay
|
type: integer
default: differs per client, see defaults below
Optional
The expected period of time for a down host to get back up again. Impacts the time between API Client retries. Note: Only available for Android, C#, Java, Go, and Scala. Default values:
|
dnsTimeout
|
type: integer
default: differs per client, see defaults below
Optional
Timeout for the dns resolution. Note: Only available for Scala. This timeout exists as Default values:
|
searchBatchTimeout
|
type: integer
default: differs per client, see defaults below
Optional
Same as requestTimeout, but applies only to batch operations. Note: Only available for Ruby. Default values:
|
searchReadTimeout
|
type: integer
default: differs per client, see defaults below
Optional
Same as requestTimeout, but applies only to search operations. Note: Only available for Ruby and Swift. Default values:
|
requestTimeout
|
type: integer
default: differs per client, see defaults below
Optional
HTTP timeout for the request. Note: Only available for Scala. Default values: This timeout allows you to configure a global timeout that supersedes all other timeouts. Since it affects all different timeouts, there is no default value. |
Response
No response.