Conversation
|
We have to be super careful around lifetimes here between the 2 vMs we don't want to segfault cause a context with timeouts got disposed. I can see people wanting both this and setInterval though I wonder if this scheduling should happen directly in C to avoid depending on Ruby here Do you have a particular use case here you are blocked on. Maybe a good opening move here is simply offering some level of interoperability in general? Ideally the amount of info we leak between VMs though should be minimal. So stuff like this should not segfault or lead to any surprises. |
I was wondering this as well. It seems like there is support in libplatform for an event loop that does this type of thing, but the documentation is scarce. Overall, if it is possible, I do think it is a better approach. Here are some examples of how others have implemented timers:
If anyone stumble on any information about implementing this in an embedded context, please post it here! The documentation on it is hard to come by.
We are SSR React in our codebase with GraphQL. Having the ability to make those queries async would speed things up a bunch.
👍 |
|
this task is beyond my current abilities for v8 and c++, so i won’t be able to implement. if anyone wants to take this on, have at it!! |
|
@ianks I know it has been quite a few years, but our new design handles all of this now, we should be good. |
This PR is a spike at adding an optional
setTimeoutimplementation. The current code is very raw, but wanted to post is so I could get some early feedback. Thoughts?