jamesge commented on issue #2755:
URL: https://github.com/apache/brpc/issues/2755#issuecomment-2326111025

   The bRPC server is asynchronous at its core, a "sync service" is just a 
service calling "done->Run()" before the service callback ends. 
   You should look at interfaces of the DB client first: 
   - If the db client has async interfaces (allowing you to pass a callback to 
be called when db access is done), you could call server's done->Run() in the 
callback. It's also possible to wrap the async DB client into a 
bthread-synchronous interfaces.
   - If the db client blocks (underlying pthread) until the db access is done, 
and the DB access is expected to last long(e.g. several seconds), you may run 
the DB client in separate pthreads. Creating extra bthreads in bRPC server do 
not help, because all bthreads are mapped to the same pool of pthread workers 
used by bRPC.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org

Reply via email to