Closing the event loop in aws lambda affects future lambda runs??
I have some aysncio python code running within an aws lambda service. The logic of the code is as follows
def lambda_handler(event,context): loop = asyncio.get_event_loop() # perform all operations with the loop loop.close() return results
If I run this once, it appears to work fine. However, if I rerun it immediately afterwards, I get an error saying Event loop closed
- Why is this happening? Shouldn't each lambda run be independent of the last? After all lambda is supposed to be stateless