ForcePilot/backend/package/yuxi/channels/application/__init__.py

68 lines
2.8 KiB
Python
Raw Normal View History

"""应用服务层。
应用服务层是 ForcePilot v1.2 多渠道网关的编排层负责
- 用例编排实现驱动端口用例协调领域服务与管道执行
- 管道装配装配入站 / 出站 / 控制面管道的阶段序列
- 事务边界在管道或用例编排器中显式控制事务边界
- 领域服务编排调用 core 层领域服务完成业务流程不在应用层重新实现业务规则
应用层仅依赖契约层yuxi.channels.contract与领域核心层yuxi.channels.core
不得直接依赖 fastapi / sqlalchemy / redis / arq 等框架设施
新增子包 framework/ 拆解迁移
- ``extension/``扩展点注册中心StageSlot/EventSubscription/ConfigSource+ EventBus + 7 个内置事件订阅者
- ``lifecycle/``插件生命周期编排状态机加载器依赖解析能力校验生命周期管理器PluginHost 实现
- ``health/``健康检查实现聚合器渠道探测诊断导出
- ``config/``配置热更新注册表
- ``circuit_breaker/``渠道级熔断器
- ``outbox/``Outbox 后台任务恢复扫描重试 Worker审计清理配对过期
- ``executor/``工具与消息操作执行器
顶层导出
- 5 个用例服务``InboundMessageService`` / ``AdminMessageService`` /
``ChannelControlService`` / ``PluginLifecycleService`` / ``HealthCheckService``
- 3 条管道``InboundPipeline`` / ``OutboundPipeline`` / ``ControlPlanePipeline``
- 3 个上下文``InboundContext`` / ``OutboundContext`` / ``ControlPlaneContext``
- 管道基础设施``Pipeline`` / ``AppStage`` / ``FailureStrategy``
"""
from __future__ import annotations
from yuxi.channels.application.context import (
ControlPlaneContext,
InboundContext,
OutboundContext,
)
from yuxi.channels.application.pipeline import AppStage, FailureStrategy, Pipeline
from yuxi.channels.application.pipeline.control_plane import ControlPlanePipeline
from yuxi.channels.application.pipeline.inbound import InboundPipeline
from yuxi.channels.application.pipeline.outbound import OutboundPipeline
from yuxi.channels.application.usecase import (
AdminMessageService,
ChannelControlService,
HealthCheckService,
InboundMessageService,
PluginLifecycleService,
)
__all__ = [
# 用例服务5 个)
"InboundMessageService",
"AdminMessageService",
"ChannelControlService",
"PluginLifecycleService",
"HealthCheckService",
# 管道3 条)
"InboundPipeline",
"OutboundPipeline",
"ControlPlanePipeline",
# 上下文3 个)
"InboundContext",
"OutboundContext",
"ControlPlaneContext",
# 管道基础设施
"Pipeline",
"AppStage",
"FailureStrategy",
]