Skip to content

how to enable require to load modules in async ways #504

Answered by khvzak
mrxsisyphus asked this question in Q&A
Discussion options

You must be logged in to vote

You need to rewrite require function to make it async as well.
See Lune example how they did it

After some exploration, I found that directly waiting for async logic in sync code (for example, using futures::executor::block_on) is feasible. However, I am not sure if this is considered a good practice.

It depends on your app logic, e.g. it's ok to block the thread if don't use async Lua glue.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mrxsisyphus
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