Update README

This commit is contained in:
taizan-hokuto
2019-11-11 23:46:04 +09:00
parent 8a0793ea64
commit 6655e1bce4

View File

@@ -45,10 +45,10 @@ while chat.is_alive():
#other background operation here. #other background operation here.
time.sleep(3) time.sleep(3)
def func(chatdata): def func(data):
for c in chatdata.items: for c in data.items:
print(f"{c.datetime} [{c.author.name}]-{c.message} {c.amountString}") print(f"{c.datetime} [{c.author.name}]-{c.message} {c.amountString}")
chat.tick() data.tick()
``` ```
### asyncio context: ### asyncio context:
@@ -62,10 +62,10 @@ async def main():
#other background operation here. #other background operation here.
await asyncio.sleep(3) await asyncio.sleep(3)
async def func(chat) async def func(data)
for c in chat.items: for c in data.items:
print(f"{c.datetime} [{c.author.name}]-{c.message} {c.amountString}") print(f"{c.datetime} [{c.author.name}]-{c.message} {c.amountString}")
await chat.tick_async() await data.tick_async()
loop = asyncio.get_event_loop() loop = asyncio.get_event_loop()
loop.run_until_complete(main()) loop.run_until_complete(main())