Coder Social home page Coder Social logo

Comments (5)

rogeralsing avatar rogeralsing commented on May 22, 2024

In what context? during ResolveActorRef ? ActorSelection?

from akka.net.

Aaronontheweb avatar Aaronontheweb commented on May 22, 2024

I'm thinking

Context.Child and Context.ActorSelection

from akka.net.

rogeralsing avatar rogeralsing commented on May 22, 2024

Yes, I checked the impl for getSingleChild on actorref, actorcell and actorselection, they all point to this method:

  override def getSingleChild(name: String): InternalActorRef =
    if (name.indexOf('#') == -1) {
      // optimization for the non-uid case
      getChildByName(name) match {
        case Some(crs: ChildRestartStats)  crs.child.asInstanceOf[InternalActorRef]
        case _                             Nobody

So you are correct :)
ActorCell.Child(...) in pigeon needs to be refactored to behave (and renamed) according to the scala code

from akka.net.

rogeralsing avatar rogeralsing commented on May 22, 2024

I made ActorCell.Child(string name) use the extension to resolve Nobody, so we don't get null refs back from this.
In Akka, there are multiple methods for this, "Child(string name)" in their case, returns "some/none" FP style.. while getSingleChild returns Nobody if not found. ¨
Not sure if we need to make a distinction on this here?

from akka.net.

Aaronontheweb avatar Aaronontheweb commented on May 22, 2024

@rogeralsing nah, seems like semantics. This is a good solution for the time being.

One thing we should consider adding (saw this in Akka) is an EmptyLocalAftorRef for this scenario - subclasses from LocalActorRef and just redirects all messages directly to DeadLetters. Seems like a good solution for being able to help debug scenarios where a Pigeon user is sending messages to a child that doesn't actually exist.

from akka.net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.