Lesson 18: [Coming Soon] Real-time Message Broadcasting

Implement efficient pub/sub patterns and message distribution systems for instant message delivery across multiple chat rooms and users

Edit on GitHub

Real-time Message Broadcasting

Coming Soon

This lesson will teach you how to build efficient message broadcasting systems for instant delivery across your chat server. You’ll learn how to:

  • Implement publish/subscribe patterns for message distribution
  • Build efficient message routing algorithms
  • Handle message delivery guarantees and failures
  • Optimize for high-throughput message broadcasting
  • Implement presence and typing indicators

What You’ll Build

By the end of this lesson, you’ll have implemented:

  • Efficient pub/sub message distribution
  • Real-time typing indicators and presence
  • Message delivery confirmation systems
  • Optimized broadcasting for large numbers of users
  • Advanced message routing and filtering

Key Concepts Preview

% Message broadcasting system
broadcast_to_room(RoomId, Message) ->
Users = chat_room:get_users(RoomId),
lists:foreach(fun(User) ->
websocket_handler:send_message(User#user.pid, Message)
end, Users).
% Pub/sub pattern
subscribe_to_room(UserId, RoomId) ->
gen_event:add_handler(room_events, {user_handler, UserId}, []).

This lesson builds on the chat server core from Lesson 16 and prepares you for the user authentication we’ll explore in Lesson 18.


This lesson is currently under development. Check back soon for the complete content!

Finished this lesson?

Mark it as complete to track your progress

This open source tutorial is brought to you by Pennypack Software - we build reliable software systems.

Found an issue? Edit this page on GitHub or open an issue