You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
474 B
25 lines
474 B
import ewents
|
|
import asyncio
|
|
|
|
@ewents.listen_on("eventA")
|
|
async def callbackA():
|
|
print("Listener A")
|
|
await ewents.emit("eventB")
|
|
|
|
@ewents.listen_on("eventB")
|
|
async def CallbackB1():
|
|
print("Listener B1")
|
|
|
|
@ewents.listen_on("eventB")
|
|
async def CallbackB2():
|
|
print("Listener B2")
|
|
|
|
|
|
async def main():
|
|
while True:
|
|
await ewents.emit("eventA")
|
|
await asyncio.sleep(2)
|
|
|
|
loop = asyncio.get_event_loop()
|
|
loop.run_until_complete(main())
|
|
loop.close()
|
|
|