Skip to content

V3: Add getters for Requests #505

@tulzke

Description

@tulzke

We use version 1 of the SDK in our company. In our internal libraries, we’ve implemented many decorators that add logic on top of the original SDK. For example, a decorator that writes Prometheus metrics. It relies on information retrieved from Call methods to construct labels, such as the function name.

When migrating to version 2 of the SDK, we encountered a problem with the recommended way of invoking procedures (Do + Request). We cannot implement such decorators anymore because Request does not expose the required getters. For example, with CallRequest, we cannot access the function name or its arguments. As a result, we are forced to change the interface of our wrappers and reduce it to the V1 style, where we internally build the required Request and call Do. We would like to use the canonical approach via Do because we do not want our wrappers to differ significantly from how the original SDK is intended to be used, but the current limitations prevent that.

My proposal is to allow typed access to payload data inside different Request types. Not via Body, since it returns msgpack, which is very inconvenient, but via typed methods. This would allow for much more flexible use of the SDK.

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