-
Notifications
You must be signed in to change notification settings - Fork 172
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
Add support for Dapr API #361
Comments
Stable Version:
|
I am willing to take this issue |
@zach030 Cool ! Which API would u want to implement? |
I wanna try State API. |
@zach030 OK |
Thx, I got it! |
@seeflood I was working on it these days, It's easy to implement the logic but I still have some confusions.
|
Wait a minute ,let me think about it
Sorry I don't understand 😢 Could u give an example or submit a WIP pull request that we can have discussion on? |
感谢!我之前的理解有点偏差🥲,这里结构转换的代码和重复的代码比较多,所以对自己写的代码有点困惑。 |
对的,大致的方案就是把原来 |
/good-first-issue cancel |
This issue has been automatically marked as stale because it has not had recent activity in the last 30 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue or help wanted) or other activity occurs. Thank you for your contributions. |
This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as pinned, good first issue or help wanted. Thank you for your contributions. |
TLDR
本提案想让开源Layotto 既支持 Layotto API,又支持Dapr API。类似于“Minio 既支持Minio API,又支持AWS S3 API”
想解决的问题
目前,我们尽量保证Layotto API 里各个字段定义的和Dapr一样,但用户真正关心的是两者sdk能否复用。虽然我们努力保证proto字段一致,但只要不能复用sdk就没解决用户的问题,还给自己增加维护成本。
比如:
因此,我们想让Layotto直接支持Dapr的grpc API (一模一样,包括 package名),对于用户来说,他可以用Dapr sdk在两者之间自由切换,不用担心被厂商绑定。
另一方面,还需要有一定扩展性。我们在生产落地的过程中发现目前的Dapr API没法完全满足需求,难免要对API做一些扩展。扩展的API已经加到了现在的 Layotto API里,提案提给了 Dapr 社区、但还在等社区慢慢接受,比如config API,比如Lock API
方案
Layotto API on Dapr API
这样的好处有:
用户价值
对于用户来说:
如果用户担心厂商绑定,可以只用Dapr API,可以用同一套Dapr sdk在Dapr 和Layotto 之间迁移,减少用户疑虑;
如果用户相信我们的落地经验、愿意用Layotto API,那他们可以用Layotto API,代价是没法用同一个sdk在两个sidecar之间迁移
Q&A
想给Dapr API加字段怎么加
想加个字段(field)
比如想给layotto api加个abc字段,可以通过metadata或者grpc头把这个字段传给dapr API
dapr API的实现再把这个字段透传给组件,组件解析这个字段
不只加字段,还要加一些逻辑、机制(mechanism)
比如layotto api加个abc字段,如果abc==true,那么runtime走一段特殊逻辑
这种情况要修改Dapr API的实现,加一段if else
想加新API怎么加
加在layotto API上,新API不需要复用Dapr API;等Dapr接收提案后再修改实现,layotto API不变
The text was updated successfully, but these errors were encountered: