github.com/dotnet/orleans

Orleans is a framework that provides a straight-forward approach to building distributed high-scale computing applications, without the need to learn and apply complex concurrency or other scaling patterns.

It was created by Microsoft Research implementing the Virtual Actor Model and designed for use in the cloud.

Orleans has been used extensively running in Microsoft Azure by several Microsoft product groups, most notably by 343 Industries as a platform for all of Halo 4 and Halo 5 cloud services, as well as by a number of other projects and companies.

Installation

Installation is performed via NuGet. There are several packages, one for each different project type (interfaces, grains, silo, and client).

In the grain interfaces project:

PM> Install-Package Microsoft.Orleans.OrleansCodeGenerator.Build

In the grain implementations project:

PM> Install-Package Microsoft.Orleans.OrleansCodeGenerator.Build

In the server (silo) project:

PM> Install-Package Microsoft.Orleans.Server

In the client project:

PM> Install-Package Microsoft.Orleans.Client

Official Builds

The stable production-quality release is located here.

The latest clean development branch build from CI is located: here

Building From Source

Clone the sources from the GitHub repo

Run run the Build.cmd script to build the binaries locally, then reference the required NuGet packages from Binaries\NuGet.Packages\*.

Documentation

Documentation is located here

Code Examples

Create an interface for your grain:

public interface IHello : Orleans.IGrainWithIntegerKey
{
  Task<string> SayHello(string greeting); }

Provide an implementation of that interface:

public class HelloGrain : Orleans.Grain, IHello { Task<string> SayHello(string greeting) { return Task.FromResult($"You said: '{greeting}', I say: Hello!"); } }

Call the grain from your Web service (or anywhere else):

// Get a reference to the IHello grain with id '0'.
var friend = GrainClient.GrainFactory.GetGrain<IHello>(0);

// Send a greeting to the grain and await the response.
Console.WriteLine(await friend.SayHello("Good morning, my friend!"));

Community

License

This project is licensed under the MIT license.

Quick Links

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值