Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
custom:javascript:callbacks [2021/04/04 20:49] – Remove use of "called" for "invoked" Deuce | custom:javascript:callbacks [2021/04/05 12:49] (current) – [Callback API] Deuce | ||
---|---|---|---|
Line 36: | Line 36: | ||
'' | '' | ||
- | Installs a callback for the string '' | + | Installs a user callback for the string '' |
'' | '' | ||
- | Adds all callbacks which were installed with the specified '' | + | Adds all user callbacks which were installed with the specified '' |
'' | '' | ||
Line 95: | Line 95: | ||
<code javascript> | <code javascript> | ||
while (js.do_callbacks && (timer_callback_count > 0 || polled_callback_count > 0 || run_queue.length > 0)) { | while (js.do_callbacks && (timer_callback_count > 0 || polled_callback_count > 0 || run_queue.length > 0)) { | ||
- | if (polled_callback_ready) { | + | |
+ | | ||
+ | timeout = 0; | ||
+ | poll_result = poll_callback_states(timeout); | ||
+ | if (poll_result.polled_callback_ready) { | ||
polled_callback.call(thisObj); | polled_callback.call(thisObj); | ||
continue; | continue; | ||
} | } | ||
- | if (timed_callback_ready) { | + | if (poll_result.timed_callback_ready) { |
timed_callback.call(thisObj); | timed_callback.call(thisObj); | ||
continue; | continue; | ||
} | } | ||
- | if (run_queue.length > 0) { | + | if (poll_result.run_queue.length > 0) { |
run_queue.shift().call(thisObj); | run_queue.shift().call(thisObj); | ||
continue; | continue; |