Open richarddd opened 7 months ago
In it's current state, all async tasks require a ctx.spawn. This works great but becomes highly inefficient when dealing with a very large number of async tasks (thousands or tens of thousands).
ctx.spawn
QuickJS has a poll function that gets called on every tick: https://github.com/bellard/quickjs/blob/2788d71e823b522b178db3b3660ce93689534e6d/quickjs-libc.c#L2080
It would be very useful to have this functionality in rquickjs.
That way we could implement timers and async callbacks with better performance as a complement to ctx.spawn.
Similarly this would allow users to add other capabilities such as signal handling.
In it's current state, all async tasks require a
ctx.spawn
. This works great but becomes highly inefficient when dealing with a very large number of async tasks (thousands or tens of thousands).QuickJS has a poll function that gets called on every tick: https://github.com/bellard/quickjs/blob/2788d71e823b522b178db3b3660ce93689534e6d/quickjs-libc.c#L2080
It would be very useful to have this functionality in rquickjs.
That way we could implement timers and async callbacks with better performance as a complement to
ctx.spawn
.Similarly this would allow users to add other capabilities such as signal handling.