Orleans框架-从示例代码开始(1)

匿名 (未验证) 提交于 2019-12-02 22:06:11

希望现在学习Orleans不会晚,毕竟Server Fabric都开源了。本篇博客从Sample的HelloWorld示例程序来解读Orleans的Grains。

Server配置参考 : https://dotnet.github.io/orleans/Documentation/clusters_and_clients/configuration_guide/server_configuration.html
Client配置参考 : https://dotnet.github.io/orleans/Documentation/clusters_and_clients/configuration_guide/client_configuration.html
对于客户端以及服务端的配置,建议配置上AddApplicationPart, 这样能够明确到Grain的类型及用途。

Grain的相关:
Grain的实现就不用说了.在这里要注意下Grain的持久化。参考 https://dotnet.github.io/orleans/Documentation/grains/grain_persistence/index.html

对于Grain的获取,我们在定义Grain接口类型的时候,会继承自:
IGrainWithStringKey、IGrainWithIntegerKey、IGrainWithGuidKey等接口,在这就指定了Grain的标志,我们定义了什么类型的Grain接口我们就使用什么类型去获取Grain. 参考: https://dotnet.github.io/orleans/Documentation/grains/grain_identity.html

示例代码:https://github.com/RyanOvO/Orleans-HelloWorld

主要的代码还是github上的,我只是完善了下Grain持久化那块。

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!