danielgtaylor / danielgtaylor/python-betterproto

Concurrent calls

Aperta
#416 0 commenti 1 reazione 0 assegnatari Vedi su GitHub
question
Lingua principale
Python
Stelle
1.8k
Fork
234
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Hello,

Is the GRPC server stub only capable of handling 1 request at a time in a sync order?
I have a heavy-loaded method that takes a while to complete, while it is working every other GRPC call is not answered until after said workload is finished. After completion, the other method calls will be handled in the requested order. The same reaction applies when calling the same heavy method twice, first the server will finish the entire call from the first request before starting the second request.

I use a Blazor web application as a client, that creates a new client for every request, so I was wondering if the python server of betterproto can not handle concurrent clients/requests?
I implemented the server as shown in the example

````
async def main():
server = Server([ControllerService()])
context = SSLContext(protocol=ssl.PROTOCOL_TLSv1_2)
context.load_cert_chain(certfile="certificate/server.crt", keyfile='certificate/server.key')
await server.start(get_config_property('controller-server-adress'), get_config_property('controller-server-port'), ssl=create_secure_context())
await server.wait_closed()

if __name__ == '__main__':
logging.basicConfig()
print("controller started")
#serve()
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
print('done.')
````

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.