Skip to content

asynkron/protoactor-dotnet

Folders and files

NameName
Last commit message
Last commit date
Sep 6, 2023
May 14, 2022
Oct 11, 2023
Oct 11, 2023
Jan 16, 2024
Jan 8, 2024
Feb 21, 2022
Sep 19, 2020
May 1, 2019
May 10, 2021
Feb 12, 2017
Aug 22, 2023
Jan 27, 2022
Mar 17, 2020
May 29, 2021
Sep 10, 2022
Jan 30, 2022
Nov 1, 2020
Sep 16, 2020
Aug 31, 2020
Apr 29, 2023
Sep 19, 2020
Jun 2, 2022
Mar 8, 2020
Feb 12, 2017
May 10, 2023

Repository files navigation

Proto.Actor

Ultra-fast, distributed, cross-platform actors.

Bootcamp Training

https://github.com/AsynkronIT/protoactor-bootcamp

Stats

Alt

Installing

Using NuGet Package Manager Console:

PM> Install-Package Proto.Actor

Source code

This is the .NET repository for Proto Actor.

Other implementations:

Design principles

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

Build on existing technologies - There are already a lot of great technologies for e.g. networking and clustering. Build on those instead of reinventing them. E.g. gRPC streams for networking, Consul 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.

Getting started

The best place currently for learning how to use Proto.Actor is the examples. Documentation and guidance is under way, but not yet complete, and can be found on the website.

Hello world

Define a message type:

internal record Hello(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 Task.CompletedTask;
    }
}

Spawn it and send a message to it:

var system = new ActorSystem();
var context = system.Root;
var props = Props.FromProducer(() => new HelloActor());
var pid = context.Spawn(props);

context.Send(pid, new Hello("Alex"));

You should see the output Hello Alex.

Sample application

https://github.com/asynkron/realtimemap-dotnet

Contributors

Made with contributors-img.

Partners, Sponsors, and Contributor Companies

Name Role
Asynkron AB Founder and owner of Proto.Actor
Helleborg AS Core contributor team
Ubiquitous AS Core contributor team
Ahoy Games Core contributor team
Etteplan Contributing tutorials, documentation