Незначительные правки

This commit is contained in:
2025-10-30 13:00:53 +03:00
parent e71685aad9
commit 4eb9327628
5 changed files with 31 additions and 128 deletions

26
src/main_example.py Normal file
View File

@@ -0,0 +1,26 @@
import os
os.chdir(os.path.dirname(__file__))
import logging
import asyncio
from config_manager.config_manager import ConfigManager
logger = logging.getLogger()
# Пример наследования и переопределения execute
class MyApp(ConfigManager):
def execute(self) -> None:
logger.info("Executing blocking work with config: %s", self.config)
async def main():
app = MyApp("config.yaml")
app.start()
await asyncio.sleep(20)
await app.stop()
logger.info("Work finished.")
if __name__ == "__main__":
asyncio.run(main())