chatlab

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package chatlab is ChatLab, a chat service: rooms, message history over HTTP and live messages over WebSocket with fan-out to every member. It is the reference app for the chat pack.

Planted bottlenecks (see README.md), each switched off by a fix flag:

  • fanout: a message is written to every member in turn while the room lock is held, so delivery time grows with the room's size and one slow reader stalls the room (fix "fanout" queues per connection and drops readers that fall too far behind).
  • history: the room log is never trimmed, and a history request encodes the whole log to return its tail, so history gets slower with every message ever sent (fix "history" keeps the last 200).
  • presence: each join and leave sends the full member list to every member, so a reconnect storm costs the square of the room's size (fix "presence" sends only who joined or left and the count).

Index

Constants

This section is empty.

Variables

View Source
var Rooms = []string{"general", "random", "support", "engineering", "sales", "town-hall"}

Rooms are the rooms ChatLab starts with.

Functions

func New

func New(cfg labkit.Config) http.Handler

New returns ChatLab's handler.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL