Changeset 57 in code for trunk/server.go


Ignore:
Timestamp:
Feb 17, 2020, 2:46:29 PM (5 years ago)
Author:
contact
Message:

Fix issues related to Ring

  • RingConsumer is now used directly in the goroutine responsible for writing downstream messages. This allows the ring buffer not to be consumed on write error.
  • RingConsumer now has a channel attached. This allows PRIVMSG messages to always use RingConsumer, instead of also directly pushing messages to all downstream connections.
  • Multiple clients with the same history name are now supported.
  • Ring is now protected by a mutex
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/server.go

    r50 r57  
    3939        upstreamConns   []*upstreamConn
    4040        downstreamConns []*downstreamConn
     41}
     42
     43func newUser(srv *Server, username string) *user {
     44        return &user{
     45                username: username,
     46                srv:      srv,
     47        }
    4148}
    4249
     
    117124func (s *Server) Run() {
    118125        // TODO: multi-user
    119         u := &user{username: "jounce", srv: s}
     126        u := newUser(s, "jounce")
    120127
    121128        s.lock.Lock()
Note: See TracChangeset for help on using the changeset viewer.