Member

public struct Member
extension SWIM.Member: Hashable, Equatable
extension SWIM.Member: CustomStringConvertible

A SWIM.Member represents an active participant of the cluster.

It associates a specific SWIMAddressablePeer with its SWIM.Status and a number of other SWIM specific state information.

  • Peer reference, used to send messages to this cluster member.

    Can represent the “local” member as well, use swim.isMyself to verify if a peer is myself.

    Declaration

    Swift

    public var peer: SWIMPeer
  • Node of the member’s peer.

    Declaration

    Swift

    public var node: ClusterMembership.Node { get }
  • Membership status of this cluster member

    Declaration

    Swift

    public var status: SWIM.Status
  • Undocumented

    Declaration

    Swift

    public var protocolPeriod: Int
  • Indicates a local point in time when suspicion was started.

    Note

    Only suspect members may have this value set, but having the actual field in SWIM.Member feels more natural.

    Note

    This value is never carried across processes, as it serves only locally triggering suspicion timeouts.

    Declaration

    Swift

    public let localSuspicionStartedAt: DispatchTime?
  • Create a new member.

    Declaration

    Swift

    public init(peer: SWIMPeer, status: SWIM.Status, protocolPeriod: Int, suspicionStartedAt: DispatchTime? = nil)
  • Convenience function for checking if a member is SWIM.Status.alive.

    Declaration

    Swift

    public var isAlive: Bool { get }

    Return Value

    true if the member is alive

  • Convenience function for checking if a member is SWIM.Status.suspect.

    Declaration

    Swift

    public var isSuspect: Bool { get }

    Return Value

    true if the member is suspect

  • Convenience function for checking if a member is SWIM.Status.unreachable

    Declaration

    Swift

    public var isUnreachable: Bool { get }

    Return Value

    true if the member is unreachable

  • Convenience function for checking if a member is SWIM.Status.dead

    Declaration

    Swift

    public var isDead: Bool { get }

    Return Value

    true if the member is dead

SWIM Member