π Search Terms
- proposal-explicit-resource-management
- ownership
- lifetime
β
Viability Checklist
β Suggestion
Better ownership lint to kill ownership chaos.
Maybe rust lifetime?
π Motivating Example
See
denoland/deno#34953
Typescript should lint below code will crash due to ownership
Deno.serve({}, async (_req) => {
using file = await Deno.open(new URL(import.meta.url).pathname);
return new Response(file.readable);
});
denoland/deno#34953 (comment)
Some think
file.readable carries ownership of the file
denoland/deno#34953 (comment)
Some think file.readable does not carries ownership of the file
> file.readable[Symbol.dispose]
undefined
π» Use Cases
- What do you want to use this for?
Better ownership type
- What shortcomings exist with current approaches?
TBD
- What workarounds are you using in the meantime?
No way.
related
denoland/deno#34931
Simple code leads to server crash due to ownership
Genered by AI.
Simplified for reproduce.
Deno.serve({}, async (_req) => {
using file = await Deno.open(new URL(import.meta.url).pathname);
return new Response(file.readable);
});
denoland/deno#34953
How to easy stream file within deno server?
tc39/proposal-explicit-resource-management#274
How does proposal-explicit-resource-management suggest how to easy extend stream file lifetime within server?
#63540
Better ownership lint to kill ownership chaos
π Search Terms
β Viability Checklist
β Suggestion
Better ownership lint to kill ownership chaos.
Maybe rust lifetime?
π Motivating Example
See
denoland/deno#34953
Typescript should lint below code will crash due to ownership
denoland/deno#34953 (comment)
Some think
denoland/deno#34953 (comment)
Some think
file.readabledoes not carries ownership of the fileπ» Use Cases
Better ownership type
TBD
No way.
related
denoland/deno#34931
Simple code leads to server crash due to ownership
Genered by AI.
Simplified for reproduce.
denoland/deno#34953
How to easy stream file within deno server?
tc39/proposal-explicit-resource-management#274
How does proposal-explicit-resource-management suggest how to easy extend stream file lifetime within server?
#63540
Better ownership lint to kill ownership chaos