Skip to content

Commit

Permalink
core: ci skip: proper comments fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
flowerinthenight committed Sep 17, 2024
1 parent 5588896 commit f7e5244
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/zgroup.zig
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ pub fn Fleet() type {
isd_queue: std.ArrayList(KeyInfo),
isd_mtx: std.Thread.Mutex = .{},

/// SWIM protocol generic commands.
pub const Command = enum(u8) {
// SWIM protocol generic commands.
const Command = enum(u8) {
noop,
ack,
nack,
Expand All @@ -43,17 +43,17 @@ pub fn Fleet() type {
ping_req,
};

/// Infection-style dissemination (ISD) commands.
pub const IsdCommand = enum(u8) {
// Infection-style dissemination (ISD) commands.
const IsdCommand = enum(u8) {
noop,
infect,
suspect,
confirm_alive,
confirm_faulty,
};

/// Possible member states.
pub const MemberState = enum(u8) {
// Possible member states.
const MemberState = enum(u8) {
alive,
suspected,
faulty,
Expand All @@ -66,8 +66,8 @@ pub fn Fleet() type {
isd_cmd: IsdCommand = .noop,
};

/// Our generic UDP comms/protocol payload.
pub const Message = packed struct {
// Our generic UDP comms/protocol payload.
const Message = packed struct {
name: u128 = 0,
// Section for ping, ping_req, ack, nack.
cmd: Command = .noop,
Expand All @@ -88,8 +88,8 @@ pub fn Fleet() type {
isd_incarnation: u64 = 0,
};

/// Per-member context data.
pub const MemberData = struct {
// Per-member context data.
const MemberData = struct {
state: MemberState = .alive,
age_faulty: std.time.Timer = undefined,
incarnation: u64 = 0,
Expand Down Expand Up @@ -214,9 +214,9 @@ pub fn Fleet() type {
}
}

// Returns a list of active members from the group/cluster. Caller owns the returning
// list, as well as each items in the array, which are duplicated from the internal
// list to prevent crashes during access due to potential changes in the main list.
/// Returns a list of active members from the group/cluster. Caller owns the returning
/// list, as well as each items in the array, which are duplicated from the internal
/// list to prevent crashes during access due to potential changes in the main list.
pub fn memberNames(self: *Self, allocator: std.mem.Allocator) !std.ArrayList([]const u8) {
var tmp = std.ArrayList([]const u8).init(allocator);
defer tmp.deinit();
Expand Down

0 comments on commit f7e5244

Please sign in to comment.