Create a dynamic rescheduling GSource in JavaScript
问题 GLib's main loop supports scheduling callback functions for periodic intervals, using g_timemout_source_new and related functions. The callback will repeatedly be called after the scheduled interval, until it returns false . I now want to modify this process with a dynamic interval. Instead of just true or false , the callback should be able to return a time value that should pass until its next invocation. Doing this in C is quite straightforward: A new GSource Type can be created, that only