raito.core.routers.manager module

class raito.core.routers.manager.RouterManager(dispatcher)[исходный код]

Базовые классы: object

Manages multiple routers and file watching.

Параметры:

dispatcher (Dispatcher)

resolve_paths(directory)[исходный код]

Recursively resolve all router paths in a directory.

Scans the given directory recursively for Python files that can contain routers. Ignores files and directories starting with underscore _

Параметры:

directory (StrOrPath) – Directory to scan for router files

Yield:

Path objects for router files found in the directory

Тип результата:

Generator[StrOrPath, None, None]

async load_routers(directory)[исходный код]

Load all routers from a directory.

Scans the directory for Python files containing routers, extracts them, handles name conflicts by adding unique suffixes, and registers them with the dispatcher.

Параметры:

directory (StrOrPath) – Directory containing router files

Исключение:

AttributeError – If a router doesn’t have a name attribute

Тип результата:

None

async start_watchdog(directory)[исходный код]

Start file watching service.

Monitors the specified directory for file changes and automatically reloads routers when their corresponding files are modified.

Параметры:

directory (StrOrPath) – Directory to watch for changes

Тип результата:

None