You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support per-request timeouts for generated client calls #6020
In Serverpod 4.1.1, connectionTimeout is configured when constructing the generated Client and is final. Generated RPC methods do not expose a per-request timeout option.
This makes it inconvenient to use different timeouts for different operations within the same authenticated client.
For example:
Regular CRUD calls should time out after 20 seconds.
AI generation calls may need up to 120 seconds.
Current workarounds
Adding Future.timeout() can shorten the caller's wait, but cannot extend the underlying client's timeout. It also does not cancel the underlying request.
Creating a separate Client with a longer timeout requires additional client lifecycle and authentication setup solely to change the timeout.
Proposed feature
Provide a way to override the timeout for an individual RPC call while retaining the Client's configured timeout as the default.
An illustrative API could be:
await client.ai.generate(
prompt,
// Client-side transport option, not an endpoint parameter.
callOptions:RpcCallOptions(
timeout:Duration(seconds:120),
),
);
Activity