Message304093
Isn't this code equivalent to yours:
async def get(process, key):
try:
return cache[key]
except KeyError:
if key in events:
await events[key].wait()
else:
events[key] = asyncio.Event()
# simulates some IO to get the Key
await asyncio.sleep(0.1)
cache[key] = "some random value"
event.set()
return cache[key]
? |
|
| Date |
User |
Action |
Args |
| 2017-10-10 23:09:30 | yselivanov | set | recipients:
+ yselivanov, pfreixes |
| 2017-10-10 23:09:30 | yselivanov | set | messageid: <1507676970.48.0.213398074469.issue30457@psf.upfronthosting.co.za> |
| 2017-10-10 23:09:30 | yselivanov | link | issue30457 messages |
| 2017-10-10 23:09:30 | yselivanov | create | |
|