Comments (2)
What speaks against pushing the message off to a worker pool or FuturesUnordered
if they tend to block? There is no requirement of having a loop over recv()
and execute all futures that are consequential from that serially in the loop body. Note that this also allows a bounded implementation, not polling the messages stream until a task is received.
Or do you require the tasks to be cancellable on a view update?
Or are you talking about the overload condition where there is an excessive amount of messages?
There is quite a bit of constraints context missing - even after reading the linked discussion - to be for or against the extension.
from orchestra.
What speaks against pushing the message off to a worker pool or
FuturesUnordered
if they tend to block?
That is exactly what we are doing right now, and that causes backpressure issues. Spawning a new task on every message effectively renders the message channel unbounded, as the number of spawned tasks is unbounded. If we try to limit the number of tasks spawned (await
ing for a free slot in some second-level task pool with a limited number of concurrent tasks to create a backpressure on the message channel), it also blocks signal processing.
The behavior we want is like that: Subsys1 sends messages to Subsys2. The latter spawns tasks, limiting the number of concurrent tasks somehow. If Subsys1 starts spamming Subsys2 with a large number of messages, each spawning a task from the Subsys2 side, at some point, the task pool gets full, and Subsys2 await
s for a free slot, thus stopping recv
ing new messages. Subsys1 has to await
on send
. Thus, backpressure is channeled from Subsys2 to Subsys1.
In principle, it works even now but blocks signal processing completely. If tasks from the Subsys2 side are heavy, potentially executing up to 60 sec, it's no good we're skipping leaf activations and even Conclude
.
That is where the idea to separate signal and message channels comes from. Hope that helps.
from orchestra.
Related Issues (20)
- attempt to get rid of `contextbounds`-proc-macro
- Avoid dependency on consumed message type, generate a marker type
- Possible extractions from the polkadot repo
- Confusing error for unconsumed message
- broadcast_signal: parallelize sending and still use a timeout for completion HOT 2
- Implement per subsystem message_capacity override.
- `CHANNEL_CAPACITY` is unused HOT 9
- Reuse subsystems in different orchestra HOT 5
- Disable signed commits HOT 6
- Consider exposing an `UnboundedMeteredSender` as orchestra handle
- Implement `try_send_message` HOT 1
- Memory bounded channels HOT 2
- Allow subsets of the graph to be printed HOT 2
- dotgraph build errors HOT 1
- Release new crate version HOT 1
- Build failure since 0.3.4 HOT 2
- Remove the timeout system HOT 11
- Version 0.3.7 introduces breaking changes HOT 2
- Add regression tests to prevent breaking changes
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 orchestra.