akka.net

I need to communicate with multiple remote actor systems

ぃ、小莉子 提交于 2019-12-06 01:37:24
问题 Im playing with using akka.Net to develop a plugin architecture whereby each dll that contains one or more plugins is loaded into its own AppDomain and a new actor system is initialized ready to recieve messages from the "Host". I become unstuck trying to get this to work with multiple plugins. So the Host config looks like: akka { actor { provider = ""Akka.Remote.RemoteActorRefProvider, Akka.Remote"" } remote { helios.tcp { transport-class = ""Akka.Remote.Transport.Helios.HeliosTcpTransport,

Akka.net and Unit tests

一世执手 提交于 2019-12-05 19:09:52
I would like to use Akka.net TestKit for writing Unit tests, but I have a question. I have a class SubscriptionService which is responsible for transmitting messages to the selected actors. public class SubscriptionService : ReceiveActor { private readonly ActorSelection service1; private readonly ActorSelection service2; public SubscriptionService() { this.service1 = Context.ActorSelection("Service1"); this.service2 = Context.ActorSelection("Service2"); this.Receive<RequestMessage>(message => this.ProcessRequestMessage(message)); } private void ProcessRequestMessage(RequestMessage message) {

Akka.net: Access remote Actors in Cluster

微笑、不失礼 提交于 2019-12-05 10:12:51
In an clustered environment I have a seed node and node1 and node2. From node1 I want to send a message to an Actor which has been created on node2. The local path to this node on node2 is akka:MyAkkaSystem/user/AnActor. Now I want to send a message from an Actor from node1 to this specific actor by using an ActorSelection like that: var actorSystem = ActorSystem.Create("MyTestSystem"); var c = actorSystem.ActorSelection("/user/ConsoleReceiver"); c.Tell("Hello World"); On node2 the actor has been created like that: var actorSystem = ActorSystem.Create("MyTestSystem"); var r = actorSystem

Proper pattern for nested asks

我的未来我决定 提交于 2019-12-05 06:52:18
问题 I have an actor with many children and I am querying it to get an aggregate of the data in its children. This operation could take a few seconds. I was about to do this and it feels so completely wrong. The handle method is called by an Ask<> . public void Handle(Message message) { var children = Context.GetChildren(); var tasks = new List<Task<Result>>(); foreach (var child in children) { var t = child.Ask<Result>(new Query); tasks.Add(t); } Task.WaitAll(tasks.ToArray()); // Gah! // do some

Akka.Net work queues

冷暖自知 提交于 2019-12-04 12:15:43
问题 I have an existing distributed computing framework built on top of MassTransit and RabbitMQ. There is essentially a manager which responds with work based on requests. Each worker will take a certain amount of items based on the physcial machine specs. The worker then sends completion messages when done. It works rather well and seems to be highly scalable since the only link is the service bus. I recently evaluated Akka.Net in order to see if that would be a simpler system to implement the

Awaiting an F# async task inside an akka.net actor{} expression

旧城冷巷雨未停 提交于 2019-12-04 10:11:56
Is it possible to wait (without blocking) on an Async<'t> within an Akka.Net actor computation? I want to achieve something similar to the following. actor { let! msg = mailbox.Receive() match msg with | Foo -> let! x = async.Return "testing 123" // Some async function, return just an example () // Do something with result } Aaronontheweb No you can't use async / await or any variant thereof inside an actor's mailbox and get safe results. Each actor maintains its own context, which includes important details like the Sender of the previous message and other important pieces of state which

Proper pattern for nested asks

☆樱花仙子☆ 提交于 2019-12-03 21:28:37
I have an actor with many children and I am querying it to get an aggregate of the data in its children. This operation could take a few seconds. I was about to do this and it feels so completely wrong. The handle method is called by an Ask<> . public void Handle(Message message) { var children = Context.GetChildren(); var tasks = new List<Task<Result>>(); foreach (var child in children) { var t = child.Ask<Result>(new Query); tasks.Add(t); } Task.WaitAll(tasks.ToArray()); // Gah! // do some work Sender.Tell(new Response(new Results())); } I have a few ideas, but wanted to get some input as I

Akka.Net VS MS Orleans Comparison [closed]

半世苍凉 提交于 2019-12-03 08:08:07
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . I've started implementing several LOB application with CQRS/ES and for this evaluating: several EMS: NServiceBus, MassTransit, RhinoMessageBus Akka.net + DDDD MS Orleans + DDDD There are lot of comparisons of different EMSs but no evaluations of Actor Frameworks. So, could you

Akka.Net work queues

随声附和 提交于 2019-12-03 07:00:16
I have an existing distributed computing framework built on top of MassTransit and RabbitMQ. There is essentially a manager which responds with work based on requests. Each worker will take a certain amount of items based on the physcial machine specs. The worker then sends completion messages when done. It works rather well and seems to be highly scalable since the only link is the service bus. I recently evaluated Akka.Net in order to see if that would be a simpler system to implement the same pattern. After looking at it I was somewhat confused at what exactly it is used for. It seems that

Async API call inside an actor and exceptions

馋奶兔 提交于 2019-12-03 06:33:12
I know about PipeTo , but some stuff, like synchronous waiting on nested continuation, seems to go against the async & await way. So, my first question [1] would be: is there any 'magic' here, so that we can just synchronously wait for nested tasks in a continuation and it's still async in the end? While we're at async & await differences, how are failures handled? Let's create a simple example: public static class AsyncOperations { public async static Task<int> CalculateAnswerAsync() { await Task.Delay(1000).ConfigureAwait(false); throw new InvalidOperationException("Testing!"); //return 42;