Wait doesn't wait for client calls. It waits for shutdown of the server. The server starts processing calls as soon as you call BuildAndStart()
On Wednesday, March 4, 2020 at 11:34:30 PM UTC-8 [email protected] wrote: > Hi, > > Since my server function need to deal with a large amount of data, I hope > that the server can work on dealing with these data when there is no client > calls. Therefore, when the client call arrives, the server can return the > already dealt results to the client which will be much more efficient. > > That means the server does work like this: > ```cpp > //server.cpp > ServerBuilder builder; > builder.AddListeningPort(); > builder.RegisterService(); > std::unique_ptr<grpc::Server> server(builder.BuildAndStart); > server->Wait(); // here the server blocks and wait for client calls. I > need the server to execute the data dealing program when there is no client > calls > ``` > > I hope that when there is no client calls, the server can still execute > some codo rather than get blocked and only wait for the client. > > How could I do this please ? > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/27c5b843-83e7-4d94-9fad-2b79ebc47653%40googlegroups.com.
