danielgtaylor / danielgtaylor/python-betterproto
Concurrent calls
- Vorherrschende Sprache
- Python
- Sterne
- 1.8k
- Forks
- 234
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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.')
````
Beitragsleitfaden
Rechercherichtung
Beginne mit dem im Issue gezeigten main()-Setup, einschließlich Server([ControllerService()]), und reproduziere gleichzeitige Aufrufe mit einer lang laufenden Methode. Untersuche das Request-Handling-Verhalten des Servers, um festzustellen, ob gleichzeitige Clients unterstützt werden und ob die beobachtete Serialisierung erwartungsgemäß ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- grpc, python
- Bereich
- api, backend
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100