Orleans框架-从示例代码开始

Posted zhiyong-itnote

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Orleans框架-从示例代码开始相关的知识,希望对你有一定的参考价值。

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





以上是关于Orleans框架-从示例代码开始的主要内容,如果未能解决你的问题,请参考以下文章

从一个简单的 JPA 示例开始

刚开始使用 Axios,需要示例代码段

Spring JDBC 示例

VisitorMathdisonen Parmatars去了吗?

java 采用流处理框架 - 代码示例

Unity 游戏框架搭建 2019 MenuItem 复用