The following table shows the supported custom configurations.

Configuration method

You can use the config module of Alibaba Cloud Go SDK to customize configurations.

config := NewConfig().
        WithEnableAsync(true).
        WithGoRoutinePoolSize(5).
        WithMaxTaskQueueSize(1000)
client, err := ecs.NewClientWithOptions("<region-id>", config, credential)
Note The config module of Alibaba Cloud Go SDK does not support the following calling method:
config := &Config{EnableAsync: true,}

Supported custom configurations

The following table shows the supported custom configurations.
Configuration Default value Description
AutoRetry true Whether to enable automatic retry.
MaxRetryTime 3 The maximum number of retries.

If the automatic retry is enabled, the maximum time consumption for a single call is: Timeout (MaxRetryTime + 1)

Timeout 10time.Second Timeout Full-link timeout, including establishing connection, redirecting, and reading response.

When the value is zero, no timeout occurs.

HttpTransport nil Enable configuration of net/http.client.

You can configure http.client with this configuration, such as persistent connection.

EnableAsync false Whether to enable the asynchronous call.
MaxTaskQueueSize 1000 This configuration takes effect only when EnableAsync=true.

When the queue is full, new calls are congested.

GoRoutinePoolSize 5 This configuration takes effect only when EnableAsync=true.