Python Asyncio Loop Forever
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
async def listener(): | |
while True: | |
message = await sqs.poll() | |
if message: | |
asyncio.ensure_future(handle(message)) | |
async def handler(message): | |
await ... | |
loop = asyncio.get_event_loop() | |
asyncio.ensure_future(listener) | |
loop.run_forever() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Web Socket version and Queue