Coder Social home page Coder Social logo

jokokko / protoactor-dotnet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from asynkron/protoactor-dotnet

0.0 2.0 0.0 465 KB

Proto Actor - Ultra fast distributed actors for Golang and C#

Home Page: http://proto.actor

License: Apache License 2.0

C# 95.81% PowerShell 2.34% Shell 1.13% Protocol Buffer 0.57% Batchfile 0.16%

protoactor-dotnet's Introduction

Build status

Join the chat at https://gitter.im/AsynkronIT/protoactor

Proto.Actor

Ultra fast distributed actors for .NET and Go

Sourcecode - C#

This is the .NET repository for Proto Actor.

The Go implementation can be found here https://github.com/AsynkronIT/protoactor-go

Design principles:

Minimalistic API - The API should be small and easy to use. Avoid enterprisey JVM like containers and configurations.

Build on existing technologies - There are already a lot of great tech for e.g. networking and clustering, build on those. e.g. gRPC streams for networking, Consul.IO for clustering.

Pass data, not objects - Serialization is an explicit concern, don't try to hide it. Protobuf all the way.

Be fast - Do not trade performance for magic API trickery.

Hello world

Define a message type:

internal class Hello
{
    public string Who;
}

Define an actor:

internal class HelloActor : IActor
{
    public Task ReceiveAsync(IContext context)
    {
        var msg = context.Message;
        if (msg is Hello r)
        {
            Console.WriteLine($"Hello {r.Who}");
        }
        return Actor.Done;
    }
}

Spawn it and send a message to it:

var props = Actor.FromProducer(() => new HelloActor());
var pid = Actor.Spawn(props);
pid.Tell(new Hello
{
    Who = "Alex"
});

For more examples, see the examples folder in this repository.

NuGet

PM> Install-Package Proto.Actor

protoactor-dotnet's People

Contributors

adamhathcock avatar alexpantyukhin avatar andersarpi avatar cpx86 avatar jasprem avatar jokokko avatar jrouaix avatar raskolnikoov avatar rikbosch avatar rogeralsing avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.