// Main method - send the line to relevant plugins func (dis *Dispatcher) Dispatch(l *line.Line) { var err error err = dis.queue.Rpush(QUEUE_PREFIX, l.JSON()) if err != nil { glog.Fatal("Error writing (RPUSH) to queue. ", err) } dis.limitQueue(QUEUE_PREFIX) }
// Dispatch the line to several channels. // We need this for QUIT for example, which goes to all channels // that user was in. func (dis *Dispatcher) DispatchMany(l *line.Line, channels []string) { for _, chName := range channels { l.Channel = chName dis.Dispatch(l) } }