danielgtaylor / danielgtaylor/python-betterproto

Concurrent calls

Abierto
#416 0 comentarios 1 reacción 0 asignados Ver en GitHub
question
Lenguaje dominante
Python
Estrellas
1.8k
Forks
234
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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.')
````

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza con la configuración de main() mostrada en el issue, incluido Server([ControllerService()]), y reproduce llamadas concurrentes con un método de larga duración. Inspecciona el comportamiento de gestión de solicitudes del servidor para determinar si se admiten clientes concurrentes y si la serialización observada es esperable.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
grpc, python
Área
api, backend
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.