Replies: 2 comments 4 replies
-
I don't know bevy, and I don't know rust (reading and learning both). But my thoughts after reading this:
|
Beta Was this translation helpful? Give feedback.
-
You could use a library like The "pivoting" can also be arranged using an async channel. You can send inputs to your compute task synchronously from your Bevy app, and on the other end you'll need to |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Background: Fractal Visualizer Project
My pet project to get more acquainted with the Rust ecosystem is to implement an interactive fractal visualizer in Rust.
I have two simultaneous goals:
100% interactivity / responsiveness
Speeeeeeeed
I wrote the initial prototype using SDL2 and rayon, with a simple message-passing scheme between the main render thread and a driver thread. However, I'm realizing that all the features I eventually want to add will probably outgrow this approach. After reading more deeply into Bevy, it seems that the ECS architecture could work quite nicely for me.
Main Question: Incremental Async Computation
In short, what is the most "Bevitious" way to report progress and/or yield a series of intermediate results from an async computation?
Currently the only async example in the Bevy repo spawns tasks whose results are not available until they are computed in their entirety. Fractals, by contrast, are computed iteratively, and can produce usable results after every iteration.
I will admit that I'm not well-versed in futures-like programming. I do have a pretty solid grasp of traditional shared-memory multithreading and message-passing, but not so much futures. So if this is something common that has already been discussed ad nauseam, then I'll happily be shooed away to other resources.
If and when I figure this out, I'd be happy to contribute another example to the Bevy repo illustrating how to report progress from async tasks (seems like that would be a common thing to do).
Beta Was this translation helpful? Give feedback.
All reactions