欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

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

程序员文章站 2022-04-28 13:09:51
希望现在学习Orleans不会晚,毕竟Server Fabric都开源了。本篇博客从Sample的HelloWorld示例程序来解读Orleans的Grains。 Server配置参考 : https://dotnet.github.io/orleans/Documentation/clusters ......

希望现在学习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持久化那块。