Skip to main content

Crate bun_event_loop

Crate bun_event_loop 

Source

Re-exports§

pub use AnyTask::JsResult;
pub use ConcurrentTask::Task;
pub use ConcurrentTask::TaskTag;
pub use ConcurrentTask::Taskable;
pub use ConcurrentTask::task_tag;
pub use AutoFlusher as auto_flusher;
pub use DeferredTaskQueue as deferred_task_queue;
pub use MiniEventLoop::EventLoopKind;
pub use MiniEventLoop::PIPE_READ_BUFFER_SIZE;
pub use MiniEventLoop::PipeReadBuffer;
pub use MiniEventLoop::PlatformEventLoop;
pub use any_event_loop::AnyEventLoop;
pub use any_event_loop::EventLoopHandle;
pub use any_event_loop::EventLoopTask;
pub use any_event_loop::EventLoopTaskPtr;

Modules§

AnyTask
This is a slower wrapper around a function pointer. Prefer adding a task type directly to Task instead of using this.
AnyTaskWithExtraContext
This is AnyTask except it gives you two pointers instead of one. Generally, prefer jsc.Task instead of this.
AutoFlusher
ConcurrentTask
A task that runs concurrently in the work pool.
ConcurrentWakeup
Process-global liveness registry for cross-thread wakeups of per-thread MiniEventLoops.
DeferredTaskQueue
Sometimes, you have work that will be scheduled, cancelled, and rescheduled multiple times The order of that work may not particularly matter.
EventLoopTimer
ManagedTask
This is a slow, dynamically-allocated one-off task Use it when you can’t add to jsc.Task directly and managing the lifetime of the Task struct is overly complex
MiniEventLoop
MiniEventLoop: A lightweight event loop for non-JavaScript contexts
SpawnSyncEventLoop
Isolated event loop for spawnSync operations.
any_event_loop

Macros§

impl_timer_owner
Stamp out one unsafe fn $method(*const EventLoopTimer) -> *mut Self per (method => field) pair: each recovers the embedding owner from a pointer to the named intrusive EventLoopTimer slot — Rust’s typed analogue of Zig’s inline @fieldParentPtr("$field", t).
link_impl_JsEventLoop

Structs§

JsEventLoop

Enums§

ErasedJsError
Historical low-tier alias for bun_jsc::JsError. The canonical enum now lives in bun_core (tier-0), so this is a straight re-export — the old “erased discriminant” split exists only to keep call sites compiling. bun.JSError — the canonical JS error union (error{JSError, OutOfMemory, JSTerminated} in Zig). Tier-0 so every layer of the runtime can name it directly; bun_jsc re-exports it as bun_jsc::JsError and bun_event_loop re-exports it as ErasedJsError for historical call sites.
JsEventLoopKind