ascii-chat
Binary v0.16.50-198-g78f51665f
Library lib/v0.3.2-2240-g78f51665f
Video chat in your terminal
Loading...
Searching...
No Matches
session_consensus Struct Reference

When code needs to work with session consensus, it keeps topology, coordinator, send_packet, on_election here instead of scattering it across globals. Initialization establishes the handles and sizes; teardown must release any allocation, lock, thread, or callback context recorded in those fields. More...

Data Fields

consensus_topology_t * topology
consensus_coordinator_t * coordinator
session_consensus_send_packet_fn send_packet
session_consensus_on_election_fn on_election
session_consensus_get_metrics_fn get_metrics
session_consensus_election_fn election
void * context
uint8_t my_id [SESSION_ID_SIZE]
bool is_leader

Detailed Description

When code needs to work with session consensus, it keeps topology, coordinator, send_packet, on_election here instead of scattering it across globals. Initialization establishes the handles and sizes; teardown must release any allocation, lock, thread, or callback context recorded in those fields.

Session adapter that owns consensus topology, coordination, and election state.

The handle connects the generic consensus modules to mode-specific callbacks, retains the local participant identity and leadership role, and forwards packet, metrics, and election events through the caller's context.

Definition at line 36 of file consensus.c.

Field Documentation

◆ context

void* session_consensus::context

Definition at line 46 of file consensus.c.

Referenced by session_consensus_create(), and session_consensus_on_election_result().

◆ coordinator

◆ election

session_consensus_election_fn session_consensus::election

Definition at line 45 of file consensus.c.

Referenced by session_consensus_create().

◆ get_metrics

session_consensus_get_metrics_fn session_consensus::get_metrics

Definition at line 44 of file consensus.c.

Referenced by session_consensus_create().

◆ is_leader

bool session_consensus::is_leader

Definition at line 50 of file consensus.c.

Referenced by session_consensus_create().

◆ my_id

uint8_t session_consensus::my_id[SESSION_ID_SIZE]

Definition at line 49 of file consensus.c.

Referenced by session_consensus_create(), and session_consensus_set_topology().

◆ on_election

session_consensus_on_election_fn session_consensus::on_election

Definition at line 43 of file consensus.c.

Referenced by session_consensus_create(), and session_consensus_on_election_result().

◆ send_packet

session_consensus_send_packet_fn session_consensus::send_packet

Definition at line 42 of file consensus.c.

Referenced by session_consensus_create().

◆ topology

consensus_topology_t* session_consensus::topology

The documentation for this struct was generated from the following file: