Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support default timeouts in clients #799

Closed
timostamm opened this issue Aug 31, 2023 · 0 comments · Fixed by #844
Closed

Support default timeouts in clients #799

timostamm opened this issue Aug 31, 2023 · 0 comments · Fixed by #844
Labels
enhancement New feature or request

Comments

@timostamm
Copy link
Member

Is your feature request related to a problem? Please describe.
In a client, a timeout for an RPC can be configured per call:

// the call will be cancelled after 3 seconds
client.introduce({ name }, { timeoutMs: 3000 })

In a setting where many different streaming procedures are called, it is not a good developer experience having to remember to set a timeout on every call.

Describe the solution you'd like
It would be a convenient to be able to specify a default timeout on the transport instead, for example:

createConnectTransport({
  baseUrl: "https://demo.connectrpc.com",
  defaultTimeoutMs: 3000, // applies to all calls that do not specify a timeout
})

If an exemption needs to be made, the default timeout could be overridden by passing timeoutMs: undefined (or perhaps timeoutMs: null to be more explicit) to a call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant