Replies: 2 comments 2 replies
-
I guess this is the biggest reason. Your suggestion for In my personal code, I don't typically make my messages serializable if they don't need to be, so I'd have to be calling Your suggestion could work however, but just isn't the approach I went with when implementing distributed actors. Is there an issue in particular you could describe with the current approach of having
Do you mean the reply type would be a stream of replies? I guess the simplest approach would be to instead send the replies as messages to an actor directly. But perhaps there could be a |
Beta Was this translation helpful? Give feedback.
-
@tqwewe another option is to provide other families of references that only depend on the message type, but it looks that it will be difficult because of the mailbox field pub struct ActorRef<A: Actor> {
id: ActorID,
mailbox: A::Mailbox,
abort_handle: AbortHandle,
pub(crate) links: Links,
pub(crate) startup_semaphore: Arc<Semaphore>,
} pub struct MesageRef<M> {
id: ActorID,
...
} |
Beta Was this translation helpful? Give feedback.
-
They all wrap an ActorID, so they have knowledge when the actor is local or remote?, it feels that the distributed case is treated as second class citizen.
Wouldn't be better to just have a uniform API for all the actors, not matter if they are local or remote?
In case a local actor is needed because the message is not serializable, an as-local function could be implemented.
ActorRef::as_local()->Option<LocalActor>
Also, which is the best way to implement something like creating a
mpsc channel
that work in the distributed case I want to send to a remote actor a message and need the actor to be able to reply many messages into a stream.Beta Was this translation helpful? Give feedback.
All reactions