예제 #1
0
 async def _read(redis):
     async with throttle(redis, 'TEST_LOCK_3', 1, 5) as value:
         return value
예제 #2
0
 async def _read(redis):
     async with throttle(redis, 'TEST_LOCK_5', 1, 5, release=True) as value:
         return value
예제 #3
0
 async def _read(redis):
     async with throttle(redis, 'TEST_LOCK_6', 1, 5, release=True) as value:
         assert (await get_lock_value('TEST_LOCK_6')) == '1'
         raise RuntimeError('runtime error')
         return value