4
私aiohttp
ウェブサーバは、時間の経過とともに変化し、グローバル変数を使用していますか?共有状態が
私aiohttp
ウェブサーバは、時間の経過とともに変化し、グローバル変数を使用していますか?共有状態が
:あなたは、インスタンスのクラスは、アプリの名前空間として機能することができ
async def handle(request):
if items['test'] == 'val':
request.app['shared_item'] = 'doeda'
print(request.app['shared_item'])
app = web.Application()
app['shared_item'] = 'bla'
ありがとう!私はこれに対する答えを見つけるのに苦労しました。 –
。 – shongololo