Closed dvonthenen closed 5 months ago
This update introduces adjustments to timeout settings and method behavior within the Deepgram SDK. Notably, it reduces the default REST timeout for improved responsiveness and introduces a specific disconnect timeout. These changes enhance the SDK's efficiency and reliability in managing connections and disconnections, aligning with user expectations for quick and stable performance.
Files | Change Summary |
---|---|
.../Abstractions/Constants.cs |
Reduced DefaultRESTTimeout from 5 minutes to 30 seconds. |
.../Live/v1/Client.cs |
Changed the Stop method's cancellation token timeout to use DefaultDisconnectTimeout . |
.../Live/v1/Constants.cs |
Introduced DefaultDisconnectTimeout with a value of 5000. |
DefaultRESTTimeout
could potentially address Objective 6 by ensuring that the transcription process is less likely to be prematurely canceled due to a long timeout setting. This change, while not directly increasing the timeout to 300 seconds, shows an effort to fine-tune timeout settings for better SDK performance.Deepgram/Clients/Live/v1/Client.cs (1)
``` User: dvonthenen" URL: https://github.com/deepgram/deepgram-dotnet-sdk/pull/264 Timestamp: 2024-04-05T14:08:43.729Z Learning: The `Stop()` method in `Deepgram/Clients/Live/v1/Client.cs` is designed to handle scenarios where a `cancelToken` might not be provided or is already cancelled, by potentially creating a new token within the method itself for internal use. This design choice ensures that the method can proceed with its operations, particularly when the socket is open and certain actions need to be taken. ```
Deepgram/Abstractions/Constants.cs (1)
`15-15`: Reducing the `DefaultRESTTimeout` to 30 seconds is a significant change that could impact existing implementations. Ensure this change is well-documented and communicated in the release notes.Deepgram/Clients/Live/v1/Constants.cs (1)
`17-17`: Adding `DefaultDisconnectTimeout` with a value of 5000 milliseconds is a good practice for managing WebSocket disconnects efficiently. Consider testing this value under various network conditions to ensure it's optimal.Deepgram/Clients/Live/v1/Client.cs (1)
`710-710`: Changing the default cancellation token timeout value in the `Stop` method to `DefaultDisconnectTimeout` is logical and aligns with the PR objectives. Ensure to add tests to verify this behavior during disconnect operations.
This just fixes the default timeout on REST operations to 30 seconds and WS connect/disconnect to 5 seconds.