Comments (8)
Got it :) We might work on it when we have time and motivation!
from ractor.
Couldn't you use the existing multi_call
and give an array of the same actor? Wouldn't that achieve the same result here?
I think there's definitely a use-case for having a MultiReplyPort
or something, so instead of a single result, you could get a stream of results for example. But normally that's not something present in Erlang's OTP, and we'd probably build a different pattern for it when needed. As an example, send a cast
with an argument of the reply actor, and then the caller sends N
messages back to the caller. But it won't block the same way as an RPC.
from ractor.
We transitioned from Riker-rs to ractor just now. We made this code because in riker, calling the actor a bunch of times and getting the results (internally via a lot of Oneshot's, just like ractor) was slow, so we made one that utilizes a mpsc channel to make it faster. (And it did improve efficiency there!)
We're not certain that this approach would necessarily be faster in ractor, but generally mpsc seems to fit better than creating a lot of oneshot's for when you have multiple messages with each a response.
Maybe we could make a benchmark, hm.
from ractor.
And also, we're not sure if multi_call
would help here, since the messages are different.
from ractor.
How would you have a mpsc
reply port if the input messages are different, therefore likely resulting in different reply types? Unless you have each message have the same return type, which then is quite flaky to provide something at a framework level, I don't see how you could make this work.
We could add a multiple-reply port, but I don't see a strong reason to do it yet (personally).
from ractor.
The messages are different as in they each have different parameters, specifically different parameters in an Enum.
The replies are the same way, different parameters in the same type as other replies.
We meant that the message values are different, not the types, sorry for the confusion.
from ractor.
The messages also have the same enum kind, they're all the same kind just different parameters.
from ractor.
We're not certain that this approach would necessarily be faster in ractor, but generally mpsc seems to fit better than creating a lot of oneshot's for when you have multiple messages with each a response.
From my point of view, this would be the only reason to add what you're requesting here. It would require a decent amount of support changes in the proc macros of ractor_cluster
I think, so i'm hesitant to do it. If you however wish to put up a PR of what it might look like I'm open to considering it! Thanks :)
from ractor.
Related Issues (20)
- bug in monte_carlo example HOT 2
- SpawnErr is misleading HOT 3
- Bidirectional linking can cause stack overflow on actor shutdown
- `CallResult` should return errors that occured handling the message HOT 2
- Add `Scope`-> `GroupName` mapping HOT 3
- Mod Driver Aplikasi Fake GPS HOT 1
- About section needs update for async-std
- Support `async fn` in traits. HOT 1
- Request for TCP Echo Server Example with TcpListener and TcpStream as Actors HOT 1
- Enum contains type of itself HOT 4
- Add support to downcast a BoxedMessage to get a reference to it's wrapped type without consuming it HOT 4
- When panic=abort is on, panic is not captured. HOT 1
- Lifetimes do not match method in trait HOT 2
- Subscriber-Driven OutputPort Subscriptions
- Enhancing OutputPort Backpressure Handling via RecvError::Lagged Management and Buffer Configurability HOT 6
- `post_stop` of children are being called when supervisor fails. HOT 1
- Not depend protobuf-src on windows HOT 1
- Compiler panics HOT 2
- Handle multiple message types HOT 1
- Awaiting input in an actor 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 ractor.