Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

服务有状态疑问 #123

Open
fengsam6 opened this issue Dec 6, 2024 · 1 comment
Open

服务有状态疑问 #123

fengsam6 opened this issue Dec 6, 2024 · 1 comment

Comments

@fengsam6
Copy link

fengsam6 commented Dec 6, 2024

是不是可以编译和运行写在一个接口(c语言这种),这样是不是可以去掉服务状态依赖

@criyle
Copy link
Owner

criyle commented Dec 6, 2024

有状态是为了性能考量(状态为缓存文件,并不持久化)。编译和运行在同一个接口则会有另外的依赖(编程语言对应的编译运行命令)。而且通常情况下,一个编译对应的是多个运行(不同的子任务),一个接口不能很好的表达这种 1:N 的关系。考虑到以上几点,暴露的接口是尽量原子化和无状态的操作。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants