Skip to content

Question: purpose of the Grpc.Status.t returned with the Ok case. #39

Open
@clembu

Description

@clembu

Hello everyone.
I'm wondering why there's a status tupled with the rpc response, as a return to Client.call.

All the examples end up matching the result with

match response with
| Ok (response, _ok) -> ...
| Error error -> ...

As there are no examples showing a use case for this status, and all existing examples end up ignoring it, I am left wondering why it is given at all. Are there any cases where it is not the OK status? If so, which values can it be?

Activity

quernd

quernd commented on Aug 8, 2023

@quernd
Collaborator

Thanks for bringing this up! These are gRPC specific status codes. It is not necessarily the OK status, and it's up to you to handle it or not.

You're right, it would be good not to ignore this code in the examples. Feel free to modify the examples and open a PR, otherwise we'll get to it some time soon.

tmcgilchrist

tmcgilchrist commented on Nov 6, 2023

@tmcgilchrist
Collaborator

An interesting example to add would be support for the gRPC health check API and implement a scenario like pausing calling a service when the health check stops responding then resuming when it is healthy again. I made an earlier start on it here https://github.com/tmcgilchrist/ocaml-grpc/tree/grpc_health_check with a view to implementing this example from Rust https://github.com/hyperium/tonic/tree/master/examples/src/health

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

        Participants

        @tmcgilchrist@clembu@quernd

        Issue actions

          Question: purpose of the `Grpc.Status.t` returned with the `Ok` case. · Issue #39 · dialohq/ocaml-grpc