Mode is an async service-based programming library built on top of asyncio. It provides Service, Worker, and BackgroundThreadService classes for composing asynchronous services. Current version is 4.4.0, requires Python ~=3.6. Release cadence is irregular.
pip install modeVerified import paths — ran on the pinned version, not inferred.
Simple example of creating and running a Mode Service.
Replace 'class MyWorker(Worker)' with 'class MyService(Service)' and adjust run() accordingly.
Change run() to be an async def that uses await asyncio.sleep() or other async patterns instead of yield.
Always use 'await service.start()' inside an async context.
If you override __init__, always call 'super().__init__(**kwargs)' at the end of your __init__.
Ensure all Mode services are created and started within the same event loop. Use 'asyncio.get_event_loop()' consistently or 'asyncio.run()' for top-level.
Change run() to use async/await pattern: 'async def run(self): await asyncio.sleep(...)' instead of 'while True: yield await ...'.
No dependency data recorded yet.