Hi ,

Check these cpp 
examples: 
https://github.com/grpc/grpc/blob/master/examples/cpp/route_guide/route_guide_callback_server.cc#L159
It's for streaming, but the same idea applies. 

Also note that you could use default reactor for unary calls (unless you 
really need to impl your own one).
`ctx->DefaultReactor()`, then you do not have to worry about this clean up. 
Although this applies only for unary calls, but this is what you are asking 
for...

In short, you can delete after OnDone was triggered for server reactor

Hope that helps!

VK

On Wednesday, January 26, 2022 at 11:29:01 PM UTC+1 brented...@gmail.com 
wrote:

> I am trying to implement grpc callback service and have derived my 
> callback handler class from ServerUnaryReactor.
>
> class AuthorisationCallbackHandler : public grpc::ServerUnaryReactor
>
> As part of request processing we return grpc::ServerUnaryReactor to grpc 
> server/service.
>
> The destructor for AuthorisationCallbackHandler is never called so I 
> assume we are still responsible for its clean up.
>
> Is this correct and how to we know grpc is finished with it?
>
> Is that what grpc::ServerUnaryReactor::OnDone is for?
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/8452515a-c3a5-4fbf-a72e-98cc6a0b2e21n%40googlegroups.com.

Reply via email to