Replies: 3 comments 2 replies
-
flowchart LR
subgraph scheduler
A[Scheduler] -->|pick| B(Platform)
B -->|fetch| C[Post]
E[Send]
end
subgraph theme
F[Theme] -->|render| D
C --> D[message]
D --> E[Send]
end
整个scheduler涉及的模块 |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
源码```mermaid zenuml title 一份快递是如何送到你手里的 Scheduler #FFEBE6 Platform #0747A6 Post #E3FCEF Theme #69a658 "send.py" @starter(Scheduler) Scheduler.exec_fetch{ Post = Platform.do_fetch_new_post(SubUnit) { Platform.get_sub_list(Target) Platform.filter_common_with_diff dispatch_user_post{ Platform.parse } } msgs = Post.generate_messages(Post){ Post.generate{ msgs = Theme.do_render } } "send.py".send_msgs(msgs) } ``` 我认为可以提出一个 Manager,用来具体执行逻辑,其他模块仅提供方法供 Manager 调用,同时在这里存放一些不好分类的函数。 Details
zenuml
title 一份快递是如何送到你手里的
Scheduler #FFEBE6
Manager #de8705
Platform #0747A6
Post #E3FCEF
Theme #69a658
"send.py"
@Starter(Scheduler)
Scheduler.exec_fetch{
RawPost = Platform.do_fetch_new_post(SubUnit) {
Platform.get_sub_list(Target)
Platform.filter_common_with_diff
}
Manager.process(RawPost){
Manager.do_filter
Manager.dispatch
Post = Platform.parse
MessageFactory = Theme.do_render(Post)
"send.py".send_msgs(MessageFactory)
}
}
|
Beta Was this translation helpful? Give feedback.
-
scheduler.exec_fetch 中的逻辑:
Beta Was this translation helpful? Give feedback.
All reactions