protoactor

Chat Example Using Proto.Remote

protoactor remote dotnet
Chat Example Using Proto.Remote In this example, we are going to go beyond Proto.Actor and leverage Proto.Remote package in order to enable bidirectional communication between different actors in a client to server fashion. These actors might be living inside of separate actor systems partitioned by a network (potentially located on different machines) and as a result of this, we are actually going to demonstrate how easy it is to create a basic but functional distributed system of actors by using just a couple of Proto features. Read more...

Context

protoactor docs
Context Proto.Actor provides two forms of Context, a RootContext and an ActorContext. These contexts are composed of various functionality provided by distinct facets. Both types of context implement Spawner, Stopper, Info and Sender facets, while the ActorContext implements additional facets. Root Context Facets Spawner Stopper Info Sender Actor Context Facets Spawner Stopper Info Sender Receiver Invoker Supervisor Context Facets Spawner Implemented by RootContext, ActorContext Read more...

Local Affinity Placement

protoactor docs
Local Affinity Virtual Actors with locality to Kafka consumer Local affinity placement lets us position virtual actors close to other resources. In this example, virtual actors are placed near an Apache Kafka consumer. The actors on the same cluster member consume messages only from the partitions handled by that consumer. Scale up or down If the cluster scales up or down, some actors may no longer reside on the node where they first spawned. Read more...

Actors

protoactor docs
Actors An actor is a container for its state, behavior, mailbox, children and supervisor strategy. All of this is encapsulated behind a process ID (PID). PID - Process ID As detailed below, an actor object needs to be shielded from the outside in order to benefit from the actor model. Therefore, actors are represented externally using PIDs, which are objects that can be passed around freely and without restriction. This split into inner and outer objects enables transparency for all the desired operations: restarting an actor without needing to update references elsewhere, placing the actual actor object on remote hosts, and sending messages to actors in completely different applications. Read more...

Benchmarks

protoactor docs
Performance and Benchmarks Lib Remote PingPong Inproc PingPong SkyNet Proto.Actor C# ~8 500 000 msg/sec ~125 000 000 msg/sec ~0.5 sec Proto.Actor Go ~5 400 000 msg/sec ~70 000 000 msg/sec ~1.2 sec Akka.NET ~350 000 msg/sec ~46 000 000 msg/sec ~4.5 sec Erlang ~200 000 msg/sc ~12 000 000 msg/sec ~0.75 sec Remote PingPong This test uses two nodes and two actors, one on each node. Read more...

Books

protoactor docs
Related Material Recommended books for further reading on reactive and actor-based systems. Manning Publications Co. Akka in action Functional and Reactive Domain Modeling Functional Reactive Programming Reactive Application Development Reactive Design Patterns

Design Principles

protoactor docs
Design principles Proto.Actor was born in the Go ecosystem, these design principles was set on day one to conform to the Go mindset. Constraints Minimalistic API Don’t bloat the API, avoid enterprisey JVM like containers and configurations. Offload features like logging, configuration, scheduling and dependency injection to 3rd party libraries. they are not part of the core problems solved by the framework. The API should be small and easy to use Read more...

Durability

protoactor docs
Message Delivery Reliability Proto.Actor helps you build reliable applications which make use of multiple processor cores in one machine (“scaling up”) or distributed across a computer network (“scaling out”). The key abstraction to make this work is that all interactions between your code units—actors—happen via message passing, which is why the precise semantics of how messages are passed between actors deserve their own chapter. In order to give some context to the discussion below, consider an application which spans multiple network hosts. Read more...

Fault Tolerance

protoactor docs
Fault Tolerance Each actor is the supervisor of its children and defines a fault-handling supervisor strategy. This strategy cannot be changed afterward, as it is an integral part of the actor system’s structure. Fault Handling in Practice Data store errors are a common source of failure in real-world applications. A typical approach is to catch exceptions and use ReenterAfter to retry the operation after a delay. The exact strategy depends on the application’s tolerance for duplicates and latency. Read more...

Features

protoactor docs
Actor Features Create actor from function/method Create actor from object factory Spawn actor with automatic/prefixed/specific name Props Settings Actor producer Mailbox producer Supervisor strategy Dispatcher Actor spawner Middleware Context Data Parent PID Self PID Sender PID Children PIDs Current message Current Actor Features Respond to sender Stash current message pending restart Spawn child actor with automatic/prefixed/specific name Stop/restart/resume children Set/push/pop actor behaviors (become/unbecome) Watch/unwatch actors Receive timeout ProcessRegistry Get Process by PID Add local Process with ID Remove Process by PID Generate next Process ID Process Send user message to Process Send system message to Process Stop Process Supervision Directives Resume Restart Stop Escalate Strategies OneForOneStrategy applies directive to failed child PID Features Holds address (nonhost or remote address) and ID Send user message Send system message Request Request future Stop Future process Auxiliary process used to provide an awaitable future containing the response to a request Dead letter process Auxiliary process used to collect messages sent to non-existing processes Routers Group routers route message to a specified set of routees Pool routers route messages to a set of routees of a specified size, and are created/managed by the router Broadcast routers routes a message to all routees Random routers routes a message to a random routee Consistent-hash routers routes a message to a routee deterministically Round-robin routers routes messages to routees in a round-robin fashion Consistent hash routers Routing is deterministic based on a hash computed by the message Uses a hash ring so that if a routee is unavailable, another will be chosen automatically, and when the routee is back it will be used again Broadcast routers Uses a special message RouterBroadcastMessage to route messages more efficiently when the routees are remote (? Read more...
Icon