pybreaker
pybreaker copied to clipboard
Async support?
Hey, pybreaker doesn't behave as expected with async code on the asyncio event loop. Is it because it isn't supported or am I doing something wrong?
Here's my code:
data_services_breaker = pybreaker.CircuitBreaker(fail_max=2, reset_timeout=60)
@data_services_breaker
async def get_all_bookings():
async with aiohttp.ClientSession() as session:
async with session.get('https://api.githubXXXX.com/events') as resp:
return await resp.text()
CircuitBreakerError is never thrown...
Thanks!
Coroutines are not supported. PRs are welcome though! 😅