akka.net

Async API call inside an actor and exceptions

爱⌒轻易说出口 提交于 2019-12-09 05:29:51
问题 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

Akka.Net Sending huge messages (maximum-frame-size)

痴心易碎 提交于 2019-12-07 17:40:18
问题 I have a question regarding increasing maximum-frame-size & send/receive-buffer-size values. Is there a limit on how high they can go? I am passing a large chunk of data into the system (say 20mb) which is then used to compute some results and return back. Setting above parameters at 100mb results in messages being dropped. The largest chunk that I could pass before this happens is about 5mb. I have tried to increase timeouts for connection and ack but it doesn't seem to make a difference.

Akka.net and Unit tests

久未见 提交于 2019-12-07 16:39:46
问题 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 =

Akka.net starting and stopping with no activity

独自空忆成欢 提交于 2019-12-07 08:10:31
I'm trying to send a message from a typesafe akka actor in Scala (2.4.11) to Akka.net actor in C# (1.0.4) I have a weird problem with my .Net actor, it keeps saying started then stopped, but I have no clue whats happening under the hood: A piece of Akka.net log: 2015-11-18 16:23:57.6168|DEBUG|Akka.Remote.Transport.ProtocolStateActor|Started (Akka.Remote.Transport.ProtocolStateActor) 2015-11-18 16:24:27.6578|DEBUG|Akka.Remote.Transport.ProtocolStateActor|Stopped 2015-11-18 16:24:42.6344|DEBUG|Akka.Remote.Transport.AkkaProtocolManager|now supervising akka://converter/system/transports

Akka.net: Access remote Actors in Cluster

丶灬走出姿态 提交于 2019-12-07 05:21:46
问题 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

How to use TestKit in Akka.NET

試著忘記壹切 提交于 2019-12-06 20:22:06
问题 I'm trying to test my Akka.NET actors, but are having some trouble with the TestKit and understanding how it works. Since there is no official documentation for unit testing in Akka.NET yet, I've explored the Akka.NET repo for example code, but the examples used there doesn't work for me. The tests I've used for reference is ReceiveActorTests.cs and ReceiveActorTests_Become.cs, since those are close to the scenario I'm trying to test in my app. Here's some dummy code: Given this actor public

Sending Akka.net cluster gossip to Azure worker role console

三世轮回 提交于 2019-12-06 14:04:03
问题 I'm developing an Azure cloud service including multiple worker roles that form an akka.net cluster. How do I accomplish getting the cluster gossip and other messages end up in the compute emulator console windows? 回答1: At the moment I'm working on an Akka.NET cluster that will be hosted as Azure Cloud Services and ran into the same problem. The quickest way I found to accomplish this is to write a logging adapter (though I' still relatively new to Akka.NET, so take this advice with a pinch

Akka.net actors in STA

限于喜欢 提交于 2019-12-06 11:55:57
问题 I need to convert thousands of ms office documents in different formats into one common format. To get things faster i would parallelize it using akka.net for. The WordSaveAsActor should: run in Single-Threaded Appartment hold the Word Application instance make COM calls on this instance, like SaveAs(..) with paths from received messages from multiple parallel threads restart itself by any crash Is it even possible to run akka.net actor in STA? Is there any concerns if I use the akka.net this

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

这一生的挚爱 提交于 2019-12-06 03:44:27
问题 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 } 回答1: 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

Akka.Net Sending huge messages (maximum-frame-size)

北城以北 提交于 2019-12-06 03:14:48
I have a question regarding increasing maximum-frame-size & send/receive-buffer-size values. Is there a limit on how high they can go? I am passing a large chunk of data into the system (say 20mb) which is then used to compute some results and return back. Setting above parameters at 100mb results in messages being dropped. The largest chunk that I could pass before this happens is about 5mb. I have tried to increase timeouts for connection and ack but it doesn't seem to make a difference. Also, if the message is being dropped, is there any way to get notified about it? Sometimes it sends a