Comments (7)
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.
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.
As I see this, there are two ways this could be implemented:
- 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
- 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.
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.
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 Id
s instead of a single PID, which I doubt would add noticeable overhead.
from protoactor-go.
A LocalEnvelope could carry a Message interface{}
, a remote envelope must serialize.
from protoactor-go.
Not planned for now
from protoactor-go.
Related Issues (20)
- ensureTopicKindRegistered is not a good idea HOT 1
- subscriber may block PubSubMemberDeliveryActor
- Remove sprintf logging HOT 1
- Batch message sent twice? HOT 2
- Logging is a breaking change HOT 1
- MemberStrategy is not work!!!
- Go coroutine thread safe HOT 2
- Is every actor message Receiver run in they own goroutine ? HOT 1
- How can a member within a cluster be restarted? HOT 2
- How can I make ‘Spawn’ return the error that occurred when 'Started' is received? HOT 4
- Data Race
- Possible memory leak HOT 3
- Go 1.21 slog HOT 3
- cluster.Request vs cluster.Call
- Port OpenTelemetry tracing from OpenTracing HOT 1
- About using your code, and copyright
- protoc-gen-gograinv2 cannot recognize google.protobuf.Empty
- How to do grain reentrance HOT 2
- Improve code generation HOT 1
- Remove GrainResponse HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from protoactor-go.