-
I am writing a chunk loading system. I want to generate chunks procedurally which can take time and must be done asynchronously. For this purpose I need AsyncTaskPools. But when using theses they randomly panic if I poll them to check if they are finished. I do nothing in the Chunk creation function except pausing the thread for test purposes. I followed the example https://github.com/bevyengine/bevy/blob/main/examples/async_tasks/async_compute.rs to write my code. The panic I get:
Here is the ChunkGeneratorPlugin:
Content of chunk generate at pos:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The problem is that you never remove the |
Beta Was this translation helpful? Give feedback.
The problem is that you never remove the
ChunkGenerationTask
component, so you end up polling theTask
contained in it again after it has already yielded a value, which results in that panic you saw. The panic message fromasync-task
is definitely not user friendly though.