{"library":"python-engineio","code":"import engineio\nimport uvicorn\n\neio = engineio.AsyncServer(async_mode='asgi')\napp = engineio.ASGIApp(eio)\n\n@eio.on('connect')\nasync def connect(sid, environ):\n    print('connect ', sid)\n\n@eio.on('message')\nasync def message(sid, data):\n    print('message ', data)\n    await eio.send(sid, 'reply from server')\n\n@eio.on('disconnect')\nasync def disconnect(sid):\n    print('disconnect ', sid)\n\n# To run the server (requires uvicorn):\n# if __name__ == '__main__':\n#     uvicorn.run(app, host='127.0.0.1', port=5000)\n\n# --- Client Example (run in a separate process/script) ---\n# import engineio\n# import asyncio\n\n# eio_client = engineio.AsyncClient()\n\n# @eio_client.on('connect')\n# async def on_connect():\n#     print('client connected')\n#     await eio_client.send('Hello from client!')\n\n# @eio_client.on('message')\n# async def on_message(data):\n#     print('client received: ', data)\n\n# @eio_client.on('disconnect')\n# async def on_disconnect():\n#     print('client disconnected')\n\n# async def start_client():\n#     await eio_client.connect('http://localhost:5000')\n#     await eio_client.wait()\n\n# # To run the client:\n# # if __name__ == '__main__':\n# #    asyncio.run(start_client())\n","lang":"python","description":"This quickstart demonstrates a basic Engine.IO server using the `AsyncServer` with ASGI mode, integrated with `uvicorn`. It defines event handlers for connect, message, and disconnect. A corresponding `AsyncClient` example is commented out, showing how to connect to the server and send/receive messages. Remember to install `uvicorn` and run the server and client in separate processes.","tag":null,"tag_description":null,"last_tested":"2026-04-24","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]}