Comments (4)
Interesting idea... I'd like to take a little time to think through the implications and implementation of this. Thank you for the submission.
from thespian.
I'm new to Thespian but having looked into ZeroMQ in the past I had similar thoughts. I found that the Troupe concept is quite similar though. With the grain of salt that I'm not familiar with the underlying architecture, it seems like either the Troupe or the specific .tell()/.send()/.ask()
call would specify a policy of send one-by-one/round-robin vs. send-to-all while the transport implementation (such as multicast vs. zmq vs. some other protocols) would be down to the ActorSystem to decide. That way the Actors only know that work is to be submitted to many other Actors at once and a multiprocTCPBase would simply duplicate messages while a multiprocUDPBase could have the option to multicast and a multiprocZMQBase could use it's own messaging paradigm (for example).
from thespian.
I would like to learn more about the use case(s) for this functionality.
At present, each Actor has an associated Address which uniquely identifies that Actor, and therefore the message sent is processed only once. This is still true for the Troupe scenario: the Address used externally is for the Troupe Leader, which in turn chooses only one of the workers to send the message to. Additionally, some of the transport implementations in Thespian attempt to ensure delivery of the message to the target Actor (asynchronously, and unbeknownst to the Actor itself)
If I understand correctly, there is interest in creating a group of Actors and using a single send()
to send a message to all of the Actors in the group. What are the expectations of behavior for this mode?
- Should each Actor be individually addressable as well as receiving "multicast" traffic?
- Message delivery would probably need to be best-effort for all transports. This is currently the way the UDP transport works, although the TCP transport attempts to ensure delivery to the target; the latter would probably need to devolve to a best effort case as well.
- At present, if a target actor encounters multiple exception failures when processing a message, that message is returned to the sender in a PoisonMessage wrapper. When used in this group scenario, there could potentially be a number of PoisonMessage returns for any single send.
- At present, if a child Actor exits, the parent receives a ChildActorExited message. The behavior for a group relates to the first item above: if Actors are individually addressable, then the exited messages can be unique, but if the group appears as a single entity to other Actors, including the parent, there could be multiple ChildActorExited deliveries for what would appear to be the same Actor.
It may be that this use case is better served by a "Router" Actor rather than embedding the functionality into Thespian itself. As j3hyde pointed out, the Router implementation could be similar to the Troupe model, replicating messages to all children rather than to just a single idle worker.
from thespian.
As I said in my original submission, the gain if having Thespian do it is having serialization overhead of O(1) instead of O(n). I don't think the group needs to be reified as a group, it'd just be nice to have an easy way to put the same message in all their inboxes. What that means copy-wise (n copies? Or one copy with n references?) Is probably up to the transport implementation. But even n copies is faster than n serializations.
from thespian.
Related Issues (20)
- Low performance sending low latency messages between actors
- Is this project still active? HOT 2
- MultiprocTCPBase cannot determine socket address when computer is offline
- Dynamically creating actors HOT 1
- Getting exceptions While Using "multiprocTCPBase" and logdefs in virtualenvironment HOT 7
- Why do I not see a reply message logging for these "Person" actors? HOT 2
- how to run thespian with an event loop HOT 1
- Error using multiprocQueueBase and multiprocTCPBase HOT 3
- Example http_server2.py doesn't work like described HOT 1
- questions: how can I avoid main thread exits when run actors with multiprocQueueBase HOT 9
- Problem with reaching an actor (from the outside) after a while HOT 5
- question: Is there any way to use/integrate external message broker ? (for example rabbitMQ) HOT 2
- self.createActor() with globalName from inisde an ActorTypeDispatcher increases size of self HOT 1
- Assorted Windows Hiccups HOT 1
- TCPTransport: multiple "dictionary changed size during iteration" issues
- multiprocTCPBase: Example keeps breaking on `InvalidActorSpecification` on my machine HOT 4
- Setting TCP_NODELAY on macOS sometimes fails HOT 9
- Dead letter handling with multiprocQueueBase implementation HOT 3
- MultiProcessQueue crashes on KeyboardInterrupt HOT 5
- `logdirector`'s "Dirty Trick" just bit me. 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 thespian.