These are chat archives for akkadotnet/akka.net

29th
Jun 2018
Sam13
@Sam13
Jun 29 2018 05:51
@alexhofer @Danthar @marcpiechura I have an actor which distributes files, if two client actors want the same file it's opened twice.
I think it's a bug in Akka since System.IO.FileInfo.Open which is used uses FileShare.None as default argument (FileStream.Openuses FileShare.Read as default).
I'll try to create a PR
Sam13
@Sam13
Jun 29 2018 07:51
Done: akkadotnet/akka.net#3531
I really had trouble to get the unit tests running - most of them are failing - any help would be appreciated...
AndreSteenbergen
@AndreSteenbergen
Jun 29 2018 08:05
Hey guys, I currently have an Flow wich starts with a Source created by Source.ActorRef<T>. And I have an actor pushing things in there. This publisher is way too fast. This method does not allow for Backpressuring. How would I create a source with Backpressure, is there an example I can follow?
AndreSteenbergen
@AndreSteenbergen
Jun 29 2018 08:16
Something like this?
source = Source.ActorPublisher<ProcessPostcode>
source.Buffer(10, OverflowStrategy.Backpressure);
Marc Piechura
@marcpiechura
Jun 29 2018 08:38
@AndreSteenbergen you could use Source.Queue and pass the queue to the actor but you need to stash/buffer messages inside the actor if the queue can't handle more messages
so you have to implement backpressure in the actor itself, there is no build in way to automatically backpressure an actor source
AndreSteenbergen
@AndreSteenbergen
Jun 29 2018 08:41
I figured that out already, that's why I am trying to implement the ActorPublisher<T>, that would work to right?
Marc Piechura
@marcpiechura
Jun 29 2018 08:45
but why ? :) do you really need an IActorRef for whatever pushes messages into the stream?
AndreSteenbergen
@AndreSteenbergen
Jun 29 2018 08:46
Good question, no I don't
Marc Piechura
@marcpiechura
Jun 29 2018 08:46
Then I would take the queue and use this as your input gateway
Stijn Herreman
@stijnherreman
Jun 29 2018 15:05
Is it possible to use async/await in a FSM actor? Like how ReceiveActor has ReceiveAsync.
Stijn Herreman
@stijnherreman
Jun 29 2018 15:14
Hmm, I guess I will have to make another attempt at fully grasping PipeTo :smile:
fleed
@fleed
Jun 29 2018 15:28
using TestKit, can I synchronously wait the handling of a message (Tell(message))?
Stijn Herreman
@stijnherreman
Jun 29 2018 15:36
@fleed There's a third-party library that may help you, see divverence/MarbleTesting#4. I didn't end up using it and went with always sending an ACK message instead to signal completion of a task.
fleed
@fleed
Jun 29 2018 16:03
Thank you @stijnherreman
EricFowler
@EricFowler
Jun 29 2018 19:41
Super easy n00bie question: Why is 'Sys' undefined in my c# akka.net application?
Alex Hofer
@alexhofer
Jun 29 2018 19:44
@EricFowler mind posting the line in question?
EricFowler
@EricFowler
Jun 29 2018 21:00
I can do that. It is just the starter sample from the tutorial at https://getakka.net/articles/intro/tutorial-1.html

using Akka;
using Akka.Actor;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyAkka
{
class Program
{
public class PrintMyActorRefActor : UntypedActor
{
protected override void OnReceive(object message)
{
switch (message)
{
case "printit":
IActorRef secondRef = Context.ActorOf(Props.Empty, "second-actor");
Console.WriteLine($"Second: {secondRef}");
break;
}
}
}
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
var firstRef = Sys.ActorOf(Props.Create<PrintMyActorRefActor>(), "first-actor");
Console.WriteLine($"First: {firstRef}");
firstRef.Tell("printit", ActorRefs.NoSender);
Console.ReadKey();
}
}
}

The problem is here:
var firstRef = Sys.ActorOf(Props.Create<PrintMyActorRefActor>(), "first-actor");
EricFowler
@EricFowler
Jun 29 2018 21:06
@alexhofer Just posted a reply; want to make sure you know about it :-)