Giter VIP home page Giter VIP logo

Comments (7)

cpx86 avatar cpx86 commented on May 18, 2024

In think we should synchronize this with the other idea of wrapping all messages in an envelope as proposed in #69.

For example, how would we handle message headers for a broadcasted message sent over the wire? Could we build broadcasting into the general message envelope by having a list of recipients? Or would it be better to wrap one of the envelopes inside the other? (and if so, in which order?)

I'm leaning towards either merging the two envelopes, or wrapping the broadcast envelope in the message envelope.

from protoactor-go.

stuartcarnie avatar stuartcarnie commented on May 18, 2024

I think the two are separate. I see BroadcastEnvelope as an implementation detail for optimizing the delivery of a message to multiple PIDs that exist on one or more remote nodes. We would generate an envelope for each remote node, with the subset of PIDs residing on that node.

As I understand it, a Message is sent via Tell, Request, etc, to a single PID. There could be middleware that inspects a header with a list of PIDs to forward this message, but I don't see that as the same thing. Something worth noting is if the header used a PIDSet to broadcast the message, it should benefit from the same optimizations based on the proposed PIDSet.Tell API.

from protoactor-go.

rogeralsing avatar rogeralsing commented on May 18, 2024

As I see this, there are two ways this could be implemented:

  1. Which I guess is what @cpx86 is leaning towards.

We have a LocalEnvelope, a RemoteEnvelope and a BroadcastEnvelop. all of which carry the message header information to the receiver.

Or

  1. We separate them to be only LocalEnvelope and RemoteEnvelope, and make the BroadcastEnvelope a separate thing with no headers.

This would mean that if we broadcast to a remote node, the broadcast envelope would have to contain a RemoteEnvelope internally. in order to also carry the header information.

from protoactor-go.

rogeralsing avatar rogeralsing commented on May 18, 2024

One thing we could do, is to let the current MessageEnvelope (in Remote) take a list of ID's instead of a PID target.

So a message could be sent to 1-n actors on a remote nod.

Not sure how this would affect allocations in the default (1 target) case.
But in theory, there is not really any different between having 1 or more targets

from protoactor-go.

stuartcarnie avatar stuartcarnie commented on May 18, 2024

Q: What is the difference between a LocalEnvelope and a RemoteEnvelope?

MessageEnvelop could work – as it also represents a single message to be delivered. It could be optimized to take one or more Ids instead of a single PID, which I doubt would add noticeable overhead.

from protoactor-go.

rogeralsing avatar rogeralsing commented on May 18, 2024

A LocalEnvelope could carry a Message interface{}, a remote envelope must serialize.

from protoactor-go.

rogeralsing avatar rogeralsing commented on May 18, 2024

Not planned for now

from protoactor-go.

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.