orleans

转:微软分布式云计算框架Orleans

假如想象 提交于 2020-01-31 02:03:13
http://www.cnblogs.com/ants/p/5122068.html 一种构建分布式、 高规模(伸缩)的应用程序 微软对奥尔良计划(Project Orleans)云计算框架开源。奥尔良计划广泛应用于微软 Azure 云服务的建设,并且是游戏《光环4》的线上基础设施的后台支持。受益于这项开源举措,在建设分布式系统方面的非专业开发者们得以更高效地建设云级别的应用。   Orleans 是一种新的编程模式,用来提升微软通用语言运行库(CLR)的抽象水平,它引入了“grains”的概念,这是一个可以在数据中心之间迁移的计算和数据存储单元。Orleans 自身还将提供很多运行时,包括 Geo-Distribution、数据复制与一致行、性能监控、自适应控制、 运行时监控、分布式调试。   Orleans 的宗旨就是为了创建一种既适用于客户端又适用于服务器的编程模式,简化代码调试,提高代码的可移植性。 官网: http://dotnet.github.io/orleans/ 文档: http://dotnet.github.io/orleans/What's-new-in-Orleans 源码: https://github.com/dotnet/orleans 来源: https://www.cnblogs.com/shy1766IT/p/6753397.html

Ensuring message sequence in Orleans in a pipelined execution

我的梦境 提交于 2020-01-15 09:40:49
问题 I have three grains (A, B and C) doing different jobs in a pipeline. GrainA will pass the result to grainB, and grainB will pass the result to grainC. I want to guarantee sequential message sending between successive grains which can be achieved by below. // client code foreach(var i in list) { await grainA.job(i); } //grain A code async Task job(var i) { DoSomeWorkA(i); await grainB.job(i); } //grain B code async Task job(var i) { DoSomeWorkB(i); await grainC.job(i); } //grain C code async

Interleaving of Orleans tasks

久未见 提交于 2020-01-05 08:36:29
问题 There is a question here where Orleans task execution in context of ContinueWith is discussed. I modified the example a bit more to check if two tasks of the same grain in Orleans can be made to interleave without the [Reentrant] flag. The entire code is here. The highlights of the code are as follows: // Client code var hashGenerator = client.GetGrain<IHashGeneratorGrain>(0); Console.WriteLine("Client making a call"); hashGenerator.Call_A_ToTemp(); await Task.Delay(10000); hashGenerator.Call

Orleans框架简单示范

纵饮孤独 提交于 2020-01-02 13:14:09
希望现在学习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

Orleans逐步教程

断了今生、忘了曾经 提交于 2020-01-02 13:13:48
参考文档: https://dotnet.github.io/orleans/Tutorials/index.html 一、通过模板创建Orleans ①下载vs插件: https://marketplace.visualstudio.com/items?itemName=sbykov.MicrosoftOrleansToolsforVisualStudio ②通过模板添加 ③引用关系 Grains引用GrainInterfaces Host引用 Grains、GrainInterfaces using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Orleans; namespace GrainInterfaces { public interface ITestGrain:IGrainWithGuidKey { Task Run(); Task<string> Get(); } } GrainInterfaces-ITestGrain using System; using System.Collections.Generic; using System.Linq; using System

Result of task invocation on a grain in Orleans

拥有回忆 提交于 2019-12-31 05:38:08
问题 I apologize for the long question. I have been experimenting with Orleans to know about its various properties and these questions are logically under one umbrella. The first test involved making request from client to a specific grain every 1 second while the grain takes 10 seconds to execute the requests. The code is this: // client code while (1) { Console.WriteLine("Client giving another request"); double temperature = random.NextDouble() * 40; var sensor = client.GetGrain

OrderBy an list in a task function async

♀尐吖头ヾ 提交于 2019-12-24 08:04:41
问题 Okay i am working with orleans and all i really want to do is sort an list after a value in state. i try to this by doing this public async Task SortEntries() { State.Entries.OrderBy(GetComparator); } private async decimal GetComparator(IEntryGrain x) { var a = await x.GetState(); return Task.FromResult(a); } but this got two wrongs in them that i am trying to solve. first of the Task SortEntries task lacks an await operator which i guess might still work the problem is that GetComparator

Orleans single threaded nature not respected by ContinueWith

戏子无情 提交于 2019-12-23 02:06:08
问题 I have the following code (https://github.com/avinash0161/OrleansExperiments/tree/c0155b4b0c8c1bfe60aea8624f2cc83a52853dc7): // Client code Console.WriteLine("Client making a call"); var hashGenerator = client.GetGrain<IGrainA>(0); hashGenerator.Call_A_ToTemp(); await Task.Delay(1000); hashGenerator.Call_B_ToTemp(); // GrainA code public async Task Call_A_ToTemp() { Console.WriteLine("Making call A to a fellow grain"); IGrainB grain = this.GrainFactory.GetGrain<IGrainB>(1); grain.CallA()

How to use FSharpx TaskBuilder with functions taking parameters

假装没事ソ 提交于 2019-12-13 07:14:27
问题 I have been lately programming with the FSharpx library and especially its TaskBuilder. Now I wonder if it should be possible to define a function which takes parameters and takes a result. Such as let doTask(parameter:int) = let task = TaskBuilder(scheduler = TaskScheduler.Current) task { return! Task.Factory.StartNew(fun() -> parameter + 1) } match FSharpx.Task.run doTask(1) with | _ -> () Looking at the source code I see run expects a function taking no parameters and returning a Task<'a>

Orleans 文档记录

帅比萌擦擦* 提交于 2019-12-06 17:24:51
Orleans 官方文档: 官方文档 http://dotnet.github.io/orleans/index.html Orleans 中文文档: 中文文档 https://orleanscn.github.io/orleans/index.html 来源: https://www.cnblogs.com/amber-L/p/11996361.html