atproto pds in zig pds.zat.dev
pds atproto
Something went wrong. Try again.
Zig
123456789101112131415161718192021222324const std = @import("std");
threadlocal var route: []const u8 = "background";
pub fn bind(value: []const u8) void { route = value;}
pub fn unbind() void { route = "background";}
pub fn currentRoute() []const u8 { return route;}
test "request route context is scoped explicitly" { try std.testing.expectEqualStrings("background", currentRoute()); bind("repo_create_record"); try std.testing.expectEqualStrings("repo_create_record", currentRoute()); unbind(); try std.testing.expectEqualStrings("background", currentRoute());}