How to handle mutiple calls at OnReceive method in Actor class in AKKA.NET using c#

Prabs 1 Reputation point
2022-12-15T10:54:55.8+00:00

Hi,
I have an C#.net core 3.1 console application. I have developed Actor model in my application using Akka.Net
How to handle multiple calls at OnReceive method (below example: Method_A() invoked multiple times simultaneously, this will making issue in my application). Please check at Actor2 class in below example.

Example:
public class Actor1: UntypedActor
{
protected override void OnReceive(object message)
{
for(int i = 100;i<=100;i++)
{
actor2.tell(message)
}
}
}

public class Actor2: UntypedActor
{
protected override void OnReceive(object message)
{
method_A(message);
}
}

Can you share me some sample code in C-Sharp?

Regards,
Prabs

.NET CLI
.NET CLI
A cross-platform toolchain for developing, building, running, and publishing .NET applications.
323 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,279 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,125 questions
{count} votes