From 7272516e78b435fe471944ee660b7b6357471f5d Mon Sep 17 00:00:00 2001 From: Nocturn9x Date: Wed, 10 May 2023 12:20:45 +0200 Subject: [PATCH] Renamed message_handler to event_handler --- tests/chatroom_server.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/chatroom_server.py b/tests/chatroom_server.py index 5ba9f77..baede7a 100644 --- a/tests/chatroom_server.py +++ b/tests/chatroom_server.py @@ -8,16 +8,16 @@ clients: dict[aiosched.socket.AsyncSocket, list[str, str]] = {} names: set[str] = set() -async def message_handler(q: aiosched.Queue): +async def event_handler(q: aiosched.Queue): """ Reads data submitted onto the queue """ try: - logging.info("Message handler spawned") + logging.info("Event handler spawned") while True: msg, payload = await q.get() - logging.info(f"Got message {msg!r} with the following payload: {payload}") + logging.info(f"Caught event {msg!r} with the following payload: {payload}") except Exception as e: logging.error(f"An exception occurred in the message handler -> {type(e).__name__}: {e}") except aiosched.errors.Cancelled: @@ -40,7 +40,7 @@ async def serve(bind_address: tuple): await sock.listen(5) logging.info(f"Serving asynchronously at {bind_address[0]}:{bind_address[1]}") async with aiosched.create_pool() as pool: - await pool.spawn(message_handler, queue) + await pool.spawn(event_handler, queue) async with sock: while True: try: