Expand description
Python 进程的监督者:启动、握手、读循环、崩溃重启与关闭。
架构位置:前端 -> Tauri 命令 -> Bridge -> Writer/FrameCodec -> Python 进程;
Supervisor 负责进程生命周期,持有唯一的 Bridge,并在进程就绪后对外提供
Supervisor::call、Supervisor::cancel 与 Supervisor::emit。
状态流转(见 Status):
Starting->Running:Python 发送协议版本匹配的hello,Rust 回复ready;Starting->Failed:进程无法启动、握手失败或超时;Running->Crashed:进程意外退出且未开启restart_on_crash;Running->Starting:意外退出且开启了restart_on_crash,按指数退避重启;Starting/Running->Stopped:调用Supervisor::shutdown。
不变量:Writer 仅在握手完成后发布、在进程结束或关闭时撤下;进程结束时所有进行中的调用
都会被 Bridge::fail_all 终止,不会无限挂起。
Structs§
- Supervisor
- Python 进程的监督者,负责其完整生命周期并转发调用、取消与事件。
- Supervisor
Config Supervisor的完整配置,由插件Builder与tauri.conf.json合并得到。
Enums§
- Status
- Python 运行时的状态,序列化为小写字符串返回给前端(
pyStatus())。