danielgtaylor / danielgtaylor/python-betterproto
Concurrent calls
- 主要言語
- Python
- スター
- 1.8k
- フォーク
- 234
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
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.')
````
コントリビューションガイド
調査の方向性
issueに示されているmain()のセットアップ(Server([ControllerService()])を含む)から始め、長時間実行されるメソッドで同時呼び出しを再現します。サーバーのリクエスト処理の動作を調査し、同時クライアントがサポートされているか、また観測されたシリアル化が想定されたものかを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- grpc, python
- 領域
- api, backend
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100