Mode-streaming is a Python library built on top of AsyncIO, designed to simplify asynchronous service-based programming. It allows users to define, start, stop, restart, and supervise services, forming a graph of dependencies. This project is a community-maintained fork of the original 'Mode' project, with a focus on continuous releases, code quality, and support for modern Python versions. The current version is 0.4.1.
pip install -U mode-streamingVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to define a basic `Service` with a periodic background task and run it using `mode.Worker`. A service can define `on_start`, `on_stop`, and timed tasks using the `@Service.timer` decorator. For command-line execution, `Worker(Service(), loglevel='info').execute_from_commandline()` is typically used.
Review release notes for versions between your current version and 0.4.0. Test thoroughly after upgrading.
Place `import gevent.monkey; gevent.monkey.patch_all()` or similar `eventlet` patching code as the first lines in your main application module.
Upgrade to version 0.4.1 or later to avoid this specific initialization issue.