mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 19:08:50 +00:00
[bun.js] 2/? Implement Response.file, sendfile edition
This commit is contained in:
@@ -298,6 +298,7 @@ pub fn IOTask(comptime Context: type) type {
|
||||
const AsyncTransformTask = @import("./api/transpiler.zig").TransformTask.AsyncTransformTask;
|
||||
const BunTimerTimeoutTask = Bun.Timer.Timeout.TimeoutTask;
|
||||
const ReadFileTask = WebCore.Blob.Store.ReadFile.ReadFileTask;
|
||||
const OpenAndStatFileTask = WebCore.Blob.Store.OpenAndStatFile.OpenAndStatFileTask;
|
||||
// const PromiseTask = JSInternalPromise.Completion.PromiseTask;
|
||||
pub const Task = TaggedPointerUnion(.{
|
||||
FetchTasklet,
|
||||
@@ -305,6 +306,7 @@ pub const Task = TaggedPointerUnion(.{
|
||||
AsyncTransformTask,
|
||||
BunTimerTimeoutTask,
|
||||
ReadFileTask,
|
||||
OpenAndStatFileTask,
|
||||
// PromiseTask,
|
||||
// TimeoutTasklet,
|
||||
});
|
||||
@@ -533,6 +535,11 @@ pub const VirtualMachine = struct {
|
||||
transform_task.*.runFromJS();
|
||||
finished += 1;
|
||||
},
|
||||
@field(Task.Tag, @typeName(OpenAndStatFileTask)) => {
|
||||
var transform_task: *OpenAndStatFileTask = task.get(OpenAndStatFileTask).?;
|
||||
transform_task.*.runFromJS();
|
||||
finished += 1;
|
||||
},
|
||||
else => unreachable,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user