Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: send message from host functions to user code #35

Open
vanesca88 opened this issue Feb 12, 2023 · 0 comments
Open

Question: send message from host functions to user code #35

vanesca88 opened this issue Feb 12, 2023 · 0 comments

Comments

@vanesca88
Copy link

I've been trying to get the host function file to be able to send a message directly to the user code.
It does work by tinkering after some tinkering, but I noticed that the C++ context has some trouble/is slow updating the user code,
if I used timers anywhere in my code.
What happens then is that the user-made function that I'm trying to call (from the host function file), only gets called after a delay, which seemingly is after my own timers have been completed.

It's pretty hard to fix this issue, because apparently the C++ context is limited by exactly 1 call at a time.
Meaning it seems like it waits for the current code/await to be completed, before running the next.

The basic gist is that I have a timer running every second, which tries to call a specific update() method in the user code.
This does work perfectly. But when another event happens in my code, it seems to "wait" until some other previous code is completed, instead of running the code instantly.
Is there an official way to call a method from the user code?
One that doesn't lag when using timers in tandem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant