Changeset 409 in code for trunk/server.go


Ignore:
Timestamp:
Aug 20, 2020, 6:05:01 PM (5 years ago)
Author:
contact
Message:

Nuke in-memory ring buffer

Instead, always read chat history from logs. Unify the implicit chat
history (pushing history to clients) and explicit chat history
(via the CHATHISTORY command).

Instead of keeping track of ring buffer cursors for each client, use
message IDs.

If necessary, the ring buffer could be re-introduced behind a
common MessageStore interface (could be useful when on-disk logs are
disabled).

References: https://todo.sr.ht/~emersion/soju/80

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/server.go

    r398 r409  
    4848        Hostname       string
    4949        Logger         Logger
    50         RingCap        int
    5150        HistoryLimit   int
    5251        LogPath        string
     
    6564        return &Server{
    6665                Logger:       log.New(log.Writer(), "", log.LstdFlags),
    67                 RingCap:      4096,
    6866                HistoryLimit: 1000,
    6967                users:        make(map[string]*user),
Note: See TracChangeset for help on using the changeset viewer.