Skip to content

Recommendation for Tweaking/Retrying Requests in Interceptors #451

@ahmedre

Description

@ahmedre

I'd like to do something similar to what I can do in an OkHttp interceptor, which is that if the response comes back with a token that is expired, for example, I can re-make the request. Today, the UnaryFunction's underlying lambda doesn't give me an easy way to re-try the request. Since the Interceptor is made per request, I can theoretically keep a reference to the HTTPRequest but don't have an obvious way to retry the request - theoretically i could pass in the ProtocolClient and call unary on it - but even this isn't ideal because it's tough to call the unary call given the templated types.

Is there a recommended way to do this? I see that the Swift sdk has something like this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions