doc: 补全部分注释

This commit is contained in:
RockChinQ
2024-03-03 16:34:59 +08:00
parent ce881372ee
commit 2fe6d731b8
34 changed files with 66 additions and 17 deletions
+1
View File
@@ -8,6 +8,7 @@ from ...config import manager as cfg_mgr
@stage.stage_class('BanSessionCheckStage')
class BanSessionCheckStage(stage.PipelineStage):
"""访问控制处理阶段"""
async def initialize(self):
pass
+1
View File
@@ -14,6 +14,7 @@ from .filters import cntignore, banwords, baiduexamine
@stage.stage_class('PostContentFilterStage')
@stage.stage_class('PreContentFilterStage')
class ContentFilterStage(stage.PipelineStage):
"""内容过滤阶段"""
filter_chain: list[filter.ContentFilter]
+1 -1
View File
@@ -85,7 +85,7 @@ class Controller:
stage_index: int,
query: entities.Query,
):
"""从指定阶段开始执行
"""从指定阶段开始执行,实现了责任链模式和基于生成器的阶段分叉功能。
如何看懂这里为什么这么写?
去问 GPT-4:
+2
View File
@@ -15,6 +15,8 @@ from ...config import manager as cfg_mgr
@stage.stage_class("LongTextProcessStage")
class LongTextProcessStage(stage.PipelineStage):
"""长消息处理阶段
"""
strategy_impl: strategy.LongTextStrategy
+1
View File
@@ -9,6 +9,7 @@ from ..platform import adapter as msadapter
class QueryPool:
"""请求池,请求获得调度进入pipeline之前,保存在这里"""
query_id_counter: int = 0
+1 -1
View File
@@ -8,7 +8,7 @@ from ...plugin import events
@stage.stage_class("PreProcessor")
class PreProcessor(stage.PipelineStage):
"""预处理
"""请求预处理阶段
"""
async def process(
+1
View File
@@ -11,6 +11,7 @@ from ...config import manager as cfg_mgr
@stage.stage_class("MessageProcessor")
class Processor(stage.PipelineStage):
"""请求实际处理阶段"""
cmd_handler: handler.MessageHandler
+1
View File
@@ -11,6 +11,7 @@ from ...core import entities as core_entities
@stage.stage_class("RequireRateLimitOccupancy")
@stage.stage_class("ReleaseRateLimitOccupancy")
class RateLimit(stage.PipelineStage):
"""限速器控制阶段"""
algo: algo.ReteLimitAlgo
+1
View File
@@ -15,6 +15,7 @@ from .preproc import preproc
from .ratelimit import ratelimit
# 请求处理阶段顺序
stage_order = [
"GroupRespondRuleCheckStage",
"BanSessionCheckStage",