grpc-rs
grpc-rs copied to clipboard
Expose grpc_channel_watch_connectivity_state to rust code
grpc_channel_watch_connectivity_state
doesn't appear in grpc-sys
even. I'll take a poke at exposing this, but I definitely haven't used the C++ level libgrpc before.
Actually, I suppose the channel isn't even exposed to the server at all right now..
Thank you! Will look into this.
Question: what's your expected Rust API look like? Can you provide some examples?
Ref: https://grpc.io/grpc/core/grpc_8h.html#a568bac9fe4004c1dd790e6569b918d2f
Function description:
Watch for a change in connectivity state.
Once the channel connectivity state is different from last_observed_state, tag will be enqueued on cq with success=1. If deadline expires BEFORE the state is changed, tag will be enqueued on cq with success=0.
Function signature:
GRPCAPI void grpc_channel_watch_connectivity_state(grpc_channel* channel,
grpc_connectivity_state last_observed_state,
gpr_timespec deadline,
grpc_completion_queue* cq,
void* tag)
Could the callback be a trait method on service traits with an inherent empty impl? Registering callbacks is difficult, I know..
Or maybe a future? A future seems straightforward.