This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const std = @import("std"); | |
| const Pool = @import("Pool.zig"); | |
| const List = @import("DoublyLinkedList.zig"); | |
| const mem = std.mem; | |
| const testing = std.testing; | |
| const Group = @This(); | |
| const Child = struct { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const std = @import("std"); | |
| const mem = std.mem; | |
| const testing = std.testing; | |
| const Pool = @import("Pool.zig"); | |
| const Counter = @import("Counter.zig"); | |
| const List = @import("DoublyLinkedList.zig"); | |
| const Mutex = std.Thread.Mutex; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const std = @import("std"); | |
| const pike = @import("pike"); | |
| const snow = @import("snow"); | |
| const timeout = @import("timeout.zig"); | |
| const time = std.time; | |
| const Self = @This(); | |
| pub const Handle = struct { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const std = @import("std"); | |
| const mem = std.mem; | |
| const meta = std.meta; | |
| const math = std.math; | |
| const debug = std.debug; | |
| const testing = std.testing; | |
| const assert = debug.assert; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pub fn Queue(comptime T: type, comptime capacity: comptime_int) type { | |
| return struct { | |
| const Self = @This(); | |
| const Reader = struct { | |
| task: pike.Task, | |
| dead: bool = false, | |
| }; | |
| const Writer = struct { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pub const Empty = struct { | |
| pub inline fn decode(buf: []const u8) !Empty { | |
| return Empty{}; | |
| } | |
| }; | |
| pub const Type = packed enum(u8) { | |
| no_op | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pub const Counter = struct { | |
| const Self = @This(); | |
| state: isize = 0, | |
| event: Event = .{}, | |
| pub fn add(self: *Self, delta: isize) void { | |
| var state = @atomicLoad(isize, &self.state, .Monotonic); | |
| var new_state: isize = undefined; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pub fn Buffer(comptime T: type, comptime capacity: comptime_int) type { | |
| return struct { | |
| items: [capacity]T = undefined, | |
| reader: Event = .{}, | |
| writer: Event = .{}, | |
| dead: bool = false, | |
| head: usize = 0, | |
| tail: usize = 0, | |
| const Self = @This(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const std = @import("std"); | |
| const pike = @import("pike/pike.zig"); | |
| const os = std.os; | |
| const net = std.net; | |
| const mem = std.mem; | |
| const log = std.log; | |
| const crypto = std.crypto; | |
| const aead = crypto.aead; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const std = @import("std"); | |
| const meta = std.meta; | |
| const math = std.math; | |
| const testing = std.testing; | |
| const assert = std.debug.assert; | |
| pub const Waker = packed struct { | |
| const Address = meta.Int(.unsigned, meta.bitCount(usize) - 1); | |
| const Self = @This(); |