Skip to content

How is AsyncComputeTaskPool supposed to be used? #4045

Answered by pubrrr
pubrrr asked this question in Q&A
Discussion options

You must be logged in to vote

From the discussion on discord:

  • offering a convenience function that reexports futures_lite::future::block_on(futures_lite::future::poll_once(&mut *task)) makes sense.
  • Storing the result in the task might be possible, but it is (at least to me) unclear how to implement that without cloning the result.
  • if task.finished { despawn task entity } is not so easy, because then bevy would need a whole system to do that. Maybe that could be solved by a prebuilt plugin, that processes certain Components, and then despawns them and sends an event out, so that the consumer can listen to some kind of "finished task" events.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@pubrrr
Comment options

Answer selected by pubrrr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant