Skip to content

[Feature Request] Per-Request Context Support #95

@Exca-DK

Description

@Exca-DK

🚀 Feature Request Description

Enable passing a context for each client method, instead of relying on a global timeout for the entire client.

Motivation

Is your feature request related to a problem? Please describe you use case.
A global timeout for all requests isn’t flexible enough. Some requests only need a few seconds, while others may take much longer. I need to handle short-duration requests without blocking event loops, while also supporting longer ones when necessary.

Pitch

Describe the solution you would like
Solution: Follow Go’s standard pattern by adding a context.Context as the first argument for each method. This would allow us to remove the global timeout on the HTTP client, relying on the context to manage request durations. Use context.Background() when no specific context is needed.

Describe alternatives you've considered
None at the moment.

Are you willing to open a pull request?
Yes, I’m happy to implement this if the feature is accepted.

Additional context

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions