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

trigger 里面的 use method 改成同步方法 #117

Open
JerrysShan opened this issue Jun 24, 2022 · 3 comments
Open

trigger 里面的 use method 改成同步方法 #117

JerrysShan opened this issue Jun 24, 2022 · 3 comments

Comments

@JerrysShan
Copy link
Collaborator

use 的行为是添加中间件到 pipeline 中的 middlewares 数组中,貌似不会产生异步的行为

@hyj1991 @noahziheng @DuanPengfei

@hyj1991
Copy link
Member

hyj1991 commented Jun 24, 2022

这个问题之前讨论过,属于一个防守策略,以后可能会有中间件设置进去之前的一些 async init 之类的方法

@JerrysShan
Copy link
Collaborator Author

如果有需要 async init 需要,是不是放在 use 外层比较合适,use API 的功能相对来说比较纯粹

@noahziheng
Copy link
Member

@hyj1991 背景是我们计划把 use 经过一定的封装之后暴露给上层框架,部分上层框架的初始化行为不一定是 async 的,这时因为底层 use 的 await 传染,就会造成用法变得诡异,这边要不还是再看下有没必要留这个口子,或许那类行为需要个 useAsync 方法?

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

3 participants