○
Planned This feature is planned but not yet implemented.
Feature: Transition metatype requires taps.eventToString and taps.branchToString which don't exist yet
Code
const std = @import("std");
~event hello {}
~event goodbye {}
~[comptime|runtime] event logger { source: []const u8, branch: []const u8, destination: ?[]const u8 }
~proc hello|zig {
std.debug.print("Hello executed\n", .{});
}
~proc goodbye|zig {
std.debug.print("Goodbye executed\n", .{});
}
~[comptime|runtime] proc logger|zig {
if (destination) |dest| {
std.debug.print("Transition: {s}.{s} -> {s}\n", .{source, branch, dest});
} else {
std.debug.print("Transition: {s}.{s} -> terminal\n", .{source, branch});
}
}
~[comptime|runtime]* -> *
| Transition t |> logger(source: taps.eventToString(t.source), branch: taps.branchToString(t.branch), destination: if (t.destination) |d| taps.eventToString(d) else null)
~hello() |> goodbye()Expected output
Transition: start.done -> terminal
Hello executed
Transition: hello.done -> goodbye
Goodbye executed
Transition: goodbye.done -> terminal
Transition: end.done -> terminal
Flows
flow ~hello click a branch to expand · @labels scroll to their anchor
hello
Test Configuration
MUST_RUN