Python Package(1)Async
asyncio
import asyncio
loop = asyncio.get_event_loop()
for record in event['Records']:
message = json.loads(record['Sns']['Message'])
loop.run_until_complete(asyncio.gather(meeting.incoming_msg(message['action'], message)))
return
It will keep sending messages to run, it will not blocking the main thread.
References:
https://www.liaoxuefeng.com/wiki/0014316089557264a6b348958f449949df42a6d3a2e542c000/001432090954004980bd351f2cd4cc18c9e6c06d855c498000
https://segmentfault.com/a/1190000008814676
asyncio
import asyncio
loop = asyncio.get_event_loop()
for record in event['Records']:
message = json.loads(record['Sns']['Message'])
loop.run_until_complete(asyncio.gather(meeting.incoming_msg(message['action'], message)))
return
It will keep sending messages to run, it will not blocking the main thread.
References:
https://www.liaoxuefeng.com/wiki/0014316089557264a6b348958f449949df42a6d3a2e542c000/001432090954004980bd351f2cd4cc18c9e6c06d855c498000
https://segmentfault.com/a/1190000008814676