macula_chatter (macula v0.20.5)
View SourceMacula Chatter - P2P PubSub Demo for NAT Traversal Testing
A pub/sub chat application that demonstrates broadcast messaging across NAT boundaries using Macula's pub/sub capabilities.
Each chatter node: - Subscribes to "chat.room.global" topic - Periodically broadcasts numbered messages to all peers - Tracks delivery metrics per peer (by NAT type) - Reports delivery rates at shutdown
PubSub Delivery Metrics: - Each broadcast includes a sequence number - Receivers track which sequence numbers they've seen per sender - Gaps in sequence numbers indicate missed messages - Delivery rate = received / expected (based on max seq seen)
Summary
Functions
Get statistics about messages sent/received
Send a direct message to a specific peer via RPC
Send a message to all peers via pubsub
Start the chatter with default settings
Start the chatter with options Options: - interval: milliseconds between broadcasts (default: 5000) - node_id: custom node identifier (default: hostname)
Functions
-spec get_stats() -> map().
Get statistics about messages sent/received
Send a direct message to a specific peer via RPC
-spec send_message(binary()) -> ok.
Send a message to all peers via pubsub
Start the chatter with default settings
Start the chatter with options Options: - interval: milliseconds between broadcasts (default: 5000) - node_id: custom node identifier (default: hostname)