Skip to main content

Module dispatch

Module dispatch 

Source
Expand description

Link-time extern implementations for EventLoopTimer and FilePoll.

In upstream Bun, bun_runtime::dispatch contains the full ~96-variant task dispatcher, the ~13-variant FilePoll dispatcher, and timer dispatch. Bao only uses SpiderMonkey (no JSC), so the full task/poll dispatch tables are unnecessary — we only bridge the timer dispatch. The FilePoll dispatch (__bun_run_file_poll) is provided as a no-op stub here because our runtime does not implement the Bun-specific poll-tag dispatch vtable; bun_io::posix_event_loop declares it extern "Rust" and expects it at link time.

Functions§

__bun_dns_prefetch
DNS cache warm — declared extern "Rust" from bun_dns.
__bun_fire_timer
Fire a timer callback.
__bun_get_vm_ctx
Process-global / thread-local event-loop context selector.
__bun_js_timer_epoch
Get the JS-timer epoch for heap ordering.
__bun_run_file_poll
FilePoll owner dispatch — routes on_update to the correct handler based on the PollTag stored in FilePoll.owner.