-
Notifications
You must be signed in to change notification settings - Fork 35
feat: xev Dynamic API + gitignore updates for Shadow support #704
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ const std = @import("std"); | |
| const Allocator = std.mem.Allocator; | ||
|
|
||
| const types = @import("@zeam/types"); | ||
| const xev = @import("xev"); | ||
| const xev = @import("xev").Dynamic; | ||
| const zeam_utils = @import("@zeam/utils"); | ||
|
|
||
| const interface = @import("./interface.zig"); | ||
|
|
@@ -774,6 +774,7 @@ test "Mock messaging across two subscribers" { | |
| defer arena_allocator.deinit(); | ||
| const allocator = arena_allocator.allocator(); | ||
|
|
||
| if (@hasDecl(xev, "detect")) xev.detect() catch @panic("no available xev backend"); | ||
| var loop = try xev.Loop.init(.{}); | ||
|
Comment on lines
+777
to
778
|
||
| defer loop.deinit(); | ||
|
|
||
|
|
@@ -954,6 +955,7 @@ test "Mock status RPC between peers" { | |
| defer arena_allocator.deinit(); | ||
| const allocator = arena_allocator.allocator(); | ||
|
|
||
| if (@hasDecl(xev, "detect")) xev.detect() catch @panic("no available xev backend"); | ||
| var loop = try xev.Loop.init(.{}); | ||
| defer loop.deinit(); | ||
|
Comment on lines
+958
to
960
|
||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -2,9 +2,18 @@ const std = @import("std"); | |||||
| const Thread = std.Thread; | ||||||
| const Mutex = Thread.Mutex; | ||||||
|
|
||||||
| const xev = @import("xev"); | ||||||
| const xev = @import("xev").Dynamic; | ||||||
| const types = @import("@zeam/types"); | ||||||
|
|
||||||
| /// Detect the best available I/O backend at runtime. | ||||||
| /// On Linux this probes io_uring, falling back to epoll (needed for Shadow). | ||||||
| /// On single-backend platforms (macOS/kqueue) this is a no-op. | ||||||
| pub fn detectBackend() void { | ||||||
| if (@hasDecl(xev, "detect")) { | ||||||
| xev.detect() catch @panic("no available xev backend"); | ||||||
|
||||||
| xev.detect() catch @panic("no available xev backend"); | |
| xev.detect() catch |err| std.debug.panic("no available xev backend: {s}", .{@errorName(err)}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
node_lib.detectBackend()currently panics on failure (seeutils.detectBackend), which bypasses the CLI’s normalErrorHandlerflow and will crash the process with a generic message. Consider changing detection to return an error and handling/logging it here (similar to thexev.Loop.initerror handling below) so startup failures are reported consistently.