Skip to content

Problems with adding Ashley entities to the engine #254

Answered by czyzby
ronjunevaldoz asked this question in Q&A
Discussion options

You must be logged in to vote

If there's an efficient way of checking if entity was added or not then retry can you share?

Unless I'm misunderstanding the problem, it looks like you're running into concurrency issues. Entity not being properly added shouldn't be a problem in the first place.

Is there a reason you're adding entities asynchronously? If there is some part of your application that's time consuming (e.g. waiting for an asset to be loaded), you might want to do that first in a coroutine and then create the entity back on the rendering thread. For example:

// Assumming that worldServer has its own executor, e.g. AsyncExecutorDispatcher:
worldServer.launch {
  // Do that expensive operation here. Perhaps so…

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by czyzby
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #254 on December 11, 2020 14:18.