Skip to content

How to implement deferred dependency loading in bevy #43

Open
@apriori

Description

@apriori

Hello, first thank you for this great crate.

I am currently using your project to implement scripting support in a project using bevy. However, I got the following issue:

  • Scripts depend on each other in an unknown (or lets say cumbersome to maintain) way
  • All scripts are loaded buy an AssetIO override that maps the path to a path into a zip file

So in all loading, the asset server is involved - and that would include loading dependencies.
Now I got the the issue that e.g. a lua snippet wants to run

dofile '/some/path/to/a/script.lua'

and would require to be paused, until the resource is available and the string contents are injected. The lua engine used (Luajit) claims to be fully resumable, so it should be possible to yield across the language barriers, however that exactly is not working with the error:

attempt to yield across C-call boundary

Is there another approach I should take when lua wants to load a resource that involves async loading from the asset server?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions