Changeset 57 in code for trunk/upstream.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/upstream.go

    r55 r57  
    4545        modes      modeSet
    4646        channels   map[string]*upstreamChannel
     47        history    map[string]uint64
    4748}
    4849
     
    6768                ring:     NewRing(u.srv.RingCap),
    6869                channels: make(map[string]*upstreamChannel),
     70                history:  make(map[string]uint64),
    6971        }
    7072
     
    306308        case "PRIVMSG":
    307309                uc.ring.Produce(msg)
    308                 uc.user.forEachDownstream(func(dc *downstreamConn) {
    309                         dc.SendMessage(msg)
    310                 })
    311310        case irc.RPL_YOURHOST, irc.RPL_CREATED:
    312311                // Ignore
Note: See TracChangeset for help on using the changeset viewer.