A kind of initial commit
This commit is contained in:
25
app/runtime.py
Normal file
25
app/runtime.py
Normal file
@@ -0,0 +1,25 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
from dataclasses import dataclass
|
||||
from typing import Any
|
||||
|
||||
import httpx
|
||||
from sqlalchemy.ext.asyncio import AsyncEngine, AsyncSession, async_sessionmaker
|
||||
|
||||
from app.clients.lastfm import LastFmClient
|
||||
from app.clients.spotify import SpotifyClient
|
||||
from app.config import Settings
|
||||
|
||||
|
||||
@dataclass
|
||||
class AppRuntime:
|
||||
settings: Settings
|
||||
engine: AsyncEngine
|
||||
session_factory: async_sessionmaker[AsyncSession]
|
||||
http_client: httpx.AsyncClient
|
||||
spotify: SpotifyClient
|
||||
lastfm: LastFmClient
|
||||
generate_lock: asyncio.Lock
|
||||
telegram_runner: Any = None
|
||||
|
||||
Reference in New Issue
Block a user