0

I have implemented a synchronous rpc server that provides a set of functions through grpc. This is grpc basic functionality and works well, but now I am looking for an ideomatic way to execute a task periodically on the synchronous grpc server - initiated by the server itself.

For example, I want to achieve something like updating a server-side cache. While updating this cache, the server must not process rpc requests to ensure consistent data.

Is there any functionality in grpc to accomplish such a task, or do I need to implement my own solution?

I was thinking about setting up a thread that periodically sends an rpc request to the server. That is, I would add an additional function to the existing grpc service. However, I think that this is not the idomatic way to implement such a use case.

Iniesta8
  • 399
  • 2
  • 15
  • Could you maybe just run another thread on the server that sleeps for – drfloob Jan 25 '23 at 18:18

0 Answers0