Akka​ 的 .NET 开源实现 Akka.NET

码农软件 · 软件分类 · 并发/并行处理框架 · 2019-09-02 18:57:03

软件介绍

Akka.NET 是 Akka 的 .NET 开源实现。用于构建强大的并发和分布式应用。Akka 是一个用 Scala 编写的库,用于简化编写容错的、高可伸缩性的 Java 和 Scala 的 Actor 模型应用。

示例代码:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Akka;
using Akka.Actor;

namespace ConsoleApplication11
{
    public class Greet
    {
        public Greet(string who)
        {
            Who = who;
        }
        public string Who { get;private set; }
    }

    public class GreetingActor : ReceiveActor
    {
        public GreetingActor()
        {
            Receive<Greet>(greet => 
               Console.WriteLine("Hello {0}", greet.Who));
        }
    }

    class Program
    {
        static void Main(string[] args)
        {
            //create a new actor system (a container for your actors)
            var system = ActorSystem.Create("MySystem");
            //create your actor and get a reference to it.
            //this will be an "ActorRef", which is not a 
            //reference to the actual actor instance
            //but rather a client or proxy to it
            var greeter = system.ActorOf<GreetingActor>("greeter");
            //send a message to the actor
            greeter.Tell(new Greet("World"));

            //this prevents the app from exiting
            //Before the async work is done
            Console.ReadLine();
        }
    }
}

本文地址:https://codercto.com/soft/d/13736.html

Python学习手册

Python学习手册

Mark Lutz / 侯靖 / 机械工业出版社 / 2009-8 / 89.00元

《Python学习手册(第3版)》讲述了:Python可移植、功能强大、易于使用,是编写独立应用程序和脚本应用程序的理想选择。无论你是刚接触编程或者刚接触Python,通过学习《Python学习手册(第3版)》,你可以迅速高效地精通核心Python语言基础。读完《Python学习手册(第3版)》,你会对这门语言有足够的了解,从而可以在你所从事的任何应用领域中使用它。 《Python学习手册(......一起来看看 《Python学习手册》 这本书的介绍吧!

随机密码生成器
随机密码生成器

多种字符组合密码

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试