tiny-tokio-actor icon indicating copy to clipboard operation
tiny-tokio-actor copied to clipboard

Should be message oriented

Open frehberg opened this issue 2 years ago • 1 comments

Right now the Actor framework is method oriented, the ActorRef is generalizing over the ActorImpl ActorRef<ActorImpl>, this is causing design-problems if one wants to store different ActorRefs over different ActorImpls in a single container. The intention of the container is to sent the same message to each one.

Instead of ActorRef<ActorImpl> the framework should use references being message oriented, such as Slot<MessageType>

Lets call this proxy (channel::tx) Slot for now.

The function create_actor() might return a single slot or multiple slots, for example

let (slot_msg_type1, slot_msg_type2) : (Slot<MsgType1>, Slot<MsgType2>) = create_actor(MyActorImpl::new(x,y,z))?;

frehberg avatar Feb 24 '23 18:02 frehberg

Thanks for this issue @frehberg! Its a problem that has vexed me for some time. I was thinking perhaps this could be solved though enums generated by a macro, similar to inventory but I havent had the chance to look into this in more detail...

fdeantoni avatar Mar 07 '23 10:03 fdeantoni