Skip to content

Add configurable client-level request timeout - #69

Open
Samuel19012002 wants to merge 1 commit into
Finnhub-Stock-API:masterfrom
Samuel19012002:Develop
Open

Add configurable client-level request timeout#69
Samuel19012002 wants to merge 1 commit into
Finnhub-Stock-API:masterfrom
Samuel19012002:Develop

Conversation

@Samuel19012002

Copy link
Copy Markdown

Summary

  • add an optional client-level timeout parameter
  • keep the existing DEFAULT_TIMEOUT behavior when the parameter is omitted
  • document how to configure the timeout in the README

Motivation

All requests currently use a fixed 10-second timeout. Allowing callers to configure it makes the client more flexible for long-running services, including MCP servers, without requiring them to mutate a class constant.

Backward compatibility

Existing Client(api_key) and Client(api_key, proxies) calls continue to use the 10-second default. Subclass and runtime overrides of DEFAULT_TIMEOUT are also preserved when no explicit timeout is provided.

Validation

  • verified the existing 10-second default
  • verified that a custom timeout is passed to the HTTP session
  • verified subclass and runtime DEFAULT_TIMEOUT overrides
  • ran git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant