○
Planned This feature is planned but not yet implemented.
TODO: Auto-dispose doesn't trigger before void event invocations
Code
~import app/fs
~tor log-done {}
~proc log-done|zig {
std.debug.print("Done!\n", .{});
}
const std = @import("std");
~app/fs:open(path: "test.txt")
| opened _ |> log-done()
Expected output
Opening file: test.txt
Closing file (auto-discharged)
Done!
Flows
flow ~open click a branch to expand · @labels scroll to their anchor
open (path: "test.txt")
Imported Files
const std = @import("std");
const File = struct { handle: i32 };
~pub tor open { path: string }
| opened *File<opened!>
~proc open|zig {
std.debug.print("Opening file: {s}\n", .{path});
const f = std.heap.page_allocator.create(File) catch unreachable;
f.* = File{ .handle = 42 };
return .{ .opened = f };
}
~pub tor close { file: *File<!opened> }
~proc close|zig {
std.debug.print("Closing file (auto-discharged)\n", .{});
}