MemberStatusChangedEvent

public struct MemberStatusChangedEvent : Equatable
extension SWIM.MemberStatusChangedEvent: CustomStringConvertible

Emitted whenever a membership change happens.

Use isReachabilityChange to detect whether the is a change from an alive to unreachable/dead state or not, and is worth emitting to user-code or not.

  • The member that this change event is about.

    Declaration

    Swift

    public let member: SWIM.Member
  • The resulting (“current”) status of the member.

    Declaration

    Swift

    public var status: SWIM.Status { get }
  • Previous status of the member, needed in order to decide if the change is “effective” or if applying the member did not move it in such way that we need to inform the cluster about unreachability.

    Declaration

    Swift

    public let previousStatus: SWIM.Status?
  • Create new event, representing a change of the member’s status from a previous state to its current state.

    Declaration

    Swift

    public init(previousStatus: SWIM.Status?, member: SWIM.Member)
  • Reachability changes are important events, in which a reachable node became unreachable, or vice-versa, as opposed to events which only move a member between .alive and .suspect status, during which the member should still be considered and no actions assuming it’s death shall be performed (yet).

    If true, a system may want to issue a reachability change event and handle this situation by confirming the node .dead, and proceeding with its removal from the cluster.

    Declaration

    Swift

    public var isReachabilityChange: Bool { get }
  • Declaration

    Swift

    public var description: String { get }