> so with what call/function can I distingush two workers on the same node on the server side? is there a handle.getID? so which should be used for user code?
It’s simple: just compare the handles. :)
The variable my_actor can be any of: caf::actor, caf::typed_actor<…>, caf::actor_addr, or caf::strong_actor_ptr.
> -------- Ursprüngliche Nachricht --------
> Von: Dominik Charousset <
dom...@charousset.de>
> Datum: 16.02.20 20:30 (GMT+01:00)
> An:
actor-f...@googlegroups.com
> Betreff: Re: [caf] Different Actors same maschine
>
> > Hi for testing purposes I want to create two actors on the same machine and connect it to another one (we use stateful_actor). However, when I run on the server
> >
> > auto sap = current_sender();
> > auto hdl = actor_cast<actor>(sap);
> >
> > both actors have exactly the same id. What can I do and how do the both actors must differ such that they will use different ids?
>
> The ID of an actor is simply an ascending integer for differentiating actors *within the same system*. Once you exchange actors between multiple systems, you get a globally unique ID by combining the actor ID and the node ID.
>
> Usually, neither actor ID not node ID are meant for user code. Actor handles take that role. Whenever CAF needs to represent an actor without any knowledge of its type, we’ll use actor_addr (which is a weak pointer, so it also won’t keep your actors alive).
>
> Hope that helps,
>
> Dominik
>
> --
> You received this message because you are subscribed to the Google Groups "actor-framework" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
actor-framewo...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/actor-framework/DCF86714-792E-47BE-9D5C-C4AB328F44CB%40charousset.de.
>
> --
> You received this message because you are subscribed to the Google Groups "actor-framework" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
actor-framewo...@googlegroups.com.