Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jan 25 14:59
    Aaronontheweb commented #3615
  • Jan 25 14:58
    Aaronontheweb commented #3615
  • Jan 25 14:56
    Aaronontheweb commented #4126
  • Jan 25 13:16
    IgorFedchenko synchronize #4126
  • Jan 25 12:37
    IgorFedchenko commented #3615
  • Jan 25 12:37
    IgorFedchenko commented #3615
  • Jan 25 12:35
    IgorFedchenko commented #3615
  • Jan 25 12:16
    IgorFedchenko synchronize #4126
  • Jan 25 12:03
    IgorFedchenko opened #4165
  • Jan 25 11:06
    IgorFedchenko synchronize #4126
  • Jan 25 10:45
    IgorFedchenko commented #4126
  • Jan 25 10:37
    IgorFedchenko synchronize #4126
  • Jan 25 10:36
    IgorFedchenko edited #4126
  • Jan 25 10:34
    IgorFedchenko synchronize #4126
  • Jan 25 10:30
    IgorFedchenko synchronize #4126
  • Jan 24 23:00
    Danthar commented #3954
  • Jan 24 22:53
    Aaronontheweb commented #3954
  • Jan 24 21:06
    Aaronontheweb synchronize #4128
  • Jan 24 16:56
    Aaronontheweb synchronize #4128
  • Jan 24 16:46

    Aaronontheweb on explain-sharding-path

    (compare)

v1rusw0rm
@v1rusw0rm
@EricFowler Sys is not Akka class, it looks like a property of object which contains tutorial code snippets.
var sys = ActorSystem.Create("tutorial-actor-system");
var firstRef = sys.ActorOf(Props.Create<PrintMyActorRefActor>(), "first-actor");
fleed
@fleed
@Aaronontheweb is it planned to implement a clean way in TestKit to wait that an actor completes the handling of a message? Currently, after a actor.Tell(something), I need to put a Thread.Sleep() or a await Task.Delay(), which doesn’t look a proper way of testing.. unless I’m missing an existing way to accomplish it. I wouldn’t like to add reply messages just to be able to test the code
Chris Dewar-English
@babelchips
Hi - hoping for a bit of clarification on something. Should I be able to run both a .NET Framework 4.5.2 node and a .NET Core 2.1 node on the same cluster and have them communicate ok? A .NET Standard shared library for the message objects should work, right?
Vasily Kirichenko
@vasily-kirichenko
@babelchips no, this is not suported
Chris Dewar-English
@babelchips
@vasily-kirichenko Ah ok.
@vasily-kirichenko Is it a serialisation issue?
Arjen Smits
@Danthar
@babelchips yes. A netstandard 2.0 compatible version is in the works.
to11mtm
@to11mtm
Hey guys... Is there some sort of rule about Priority Mailboxes and Tell/Ask from outside the system? I've got a thing happening where it looks like none of my messages sent from outside the system (directly, i.e. local IActorRef) are going through the mailbox.
the message gets received by the actor, and when the actor gets messages from it's children (The only other thing really inside the system) those do go through the mailbox
to11mtm
@to11mtm
Ahhh.... I think I figured it out. It looks like mailbox gets involved in prioritizing when there is more than one message enqueued to the mailbox!
Arsene
@Tochemey
Hello can some one point to me the package which contains the HttpRequest component in Akka Streams
Aaron Stannard
@Aaronontheweb
@babelchips akkadotnet/akka.net#2947
the out of the box JSON.NET serialization won't work
due to the namespaces for primitive types in .NET being different
from how they are in .NET Core
so a .NET 4.5.2 string can't be successfully deserialized back into a .NET Core 2.1 string without that
no idea why Microsoft did that
but there it is
if you implement a custom serializer like Google Protobuf
or MsgPack
or just use that hack with JSON.NET
you'll be good to go
Chris Dewar-English
@babelchips
@Aaronontheweb Interesting. I think I’ll give that a go. Thanks.
Marc Piechura
@marcpiechura
@Tochemey I don’t think we have a HttpRequest component in akka.streams
chipdice
@chipdice
@Aaronontheweb I upgraded my projects to 1.3.8 with DotNetty 0.4.8 to fix our port exhaustion issue. Last night it looked like we were starting to eat up ports again, but I'm not sure it was the same issue. I've calculated that I should have 360 connections between the 3 different clusters that are running. What should I be looking for when we start to open a lot of ports?
AndreSteenbergen
@AndreSteenbergen
Are there any good design patterns for telling a command to a large group of actors (100k actors or so) and waiting for an answer from all of them? Like the Aggregator pattern @Horusiath blogged about in https://bartoszsypytkowski.com/dont-ask-tell-2/
Arjen Smits
@Danthar
@stijnherreman I dont have time to go into detail right now. But have you looked at the PipeTo extensionmethod ?
Basically what you would do is use PipeTo to send the result as a message back to yourself
and have a seperate handler for that
Stijn Herreman
@stijnherreman
I did at some point when learning Akka but didn't really understand how to properly use it
AndreSteenbergen
@AndreSteenbergen
My bet is an Aggregator with a HashSet of actors waiting to start and an active set of current workers
Stijn Herreman
@stijnherreman
My concern is that it would require splitting up the single method in multiple parts, if I understand it correctly
Arjen Smits
@Danthar
if you want your actor to block processing while its working on 1 message, you can use a combination of Become to switch states, and Stashing to stash any new Bar message, once your done, you unstash all and switch back to your initial behavior.
Regarding splitting up. yes it would
You are splitting up your async work across (either the same actor) actors
So if you want to async delete alot of stuff at the same time. You can use a workerpool and delegate that work to them. So e.g. using a workerpool as a childactor in your main actor.
that opens up to door to use supervisionstrategies on that particular action. So if it fails, you can opt to retry, or simply ignore it.
In your current code, if it fails to delete 1 file out of the 1000s in your zip (for example) it will fail the entire message
if that actor is then restarted and the message retried... well... you might have issues :P
Arjen Smits
@Danthar
@AndreSteenbergen you want to throttle the amount of actors you are currently sending work to ? Then yes, keeping track of how many you have contacted, and how many have answered is the way to go
And yes, using a HashSet of IActorRef would make that even easier.
AndreSteenbergen
@AndreSteenbergen
Thanks already started creating a ThrottledMessenger, isn't that hard, but it might have already lived somewhere in the akka system.
AndreSteenbergen
@AndreSteenbergen
I guess this does what I need ...
static class CollectionExtensions
{
    public static T RemoveFirst<T>(this ICollection<T> items)
    {
        T item = items.FirstOrDefault();
        if (item != null)
        {
            items.Remove(item);
        }
        return item;
    }
}

public class ThrottledMessenger : ReceiveActor
{
    private readonly HashSet<IActorRef> workerPool;
    private readonly HashSet<IActorRef> waitingActors;
    private IActorRef originalSender;
    private object originalMessage;

    public ThrottledMessenger(int parallelWorkers, IEnumerable<IActorRef> refs)
    {
        workerPool = new HashSet<IActorRef>(refs.Take(parallelWorkers));
        waitingActors = new HashSet<IActorRef>(refs.Skip(parallelWorkers));

        ReceiveAny(x =>
        {
            originalSender = Sender;
            originalMessage = x;

            foreach (var aref in workerPool) aref.Tell(x);
            Become(Messenging);
        });
    }

    private void Messenging()
    {
        ReceiveAny(msg =>
        {
            if (workerPool.Remove(Sender))
            {
                originalSender.Tell(msg, Sender);

                var nextActor = waitingActors.RemoveFirst();
                if (nextActor != null)
                {
                    workerPool.Add(nextActor);
                    nextActor.Tell(originalMessage);
                }
                else if (workerPool.Count == 0)
                {
                    Context.Stop(Self);
                }
            }
        });
    }
}
Am I missing something?
It acting like a proxy I guess
Arjen Smits
@Danthar
Why are you using a HashSet for waitingActors ? Looks like a Queue seems like a better fit.
AndreSteenbergen
@AndreSteenbergen
Thanks, yes you are correct.
Queue would be better