Expand description
A task that runs concurrently in the work pool.
This is used to run tasks that are CPU-intensive or blocking on the work pool. It’s also used to run tasks that need to be run on a different thread than the main JavaScript thread.
The task is run on a thread pool and then the result is returned to the main JavaScript thread.
If auto_delete is true, the task is automatically deallocated when it’s finished.
Otherwise, it’s expected that the containing struct will deallocate the task.
Modules§
- task_
tag - Tag constants for
Task— one per variant of Zig’sjsc.TaskTaggedPointerUnion(src/jsc/Task.zig). Values are sequential by source order;bun_runtime::dispatch::run_taskmatches on these. Both sides MUST agree — adding a variant requires updating both this list and the runtime match arm.
Structs§
Enums§
Traits§
- Taskable
- Type → tag binding for
Task. Implement on every type that can be enqueued; the impl lives in whatever crate owns the type (mirrors Zig’s comptimeTaggedPointerUniontype-list lookup, where the tag was derived from@typeName(std.meta.Child(@TypeOf(ptr)))).