<commit_before>package conn

import (
	"sync"
	"time"

	"github.com/berkaroad/uuid"
)

type Topic struct {
	name         string
	MsgChan      chan *Message
	FailMsgChan  chan *Message
	ExitChan     chan int
	producterMgr *ClientManager
	consumerMgr  *ClientManager
}

func NewTopic(name string, client *Client) *Topic {
	t := new(Topic)
	t.name = name
	t.MsgChan = make(chan *Message, 1000)
	t.FailMsgChan = make(chan *Message, 1000)
	t.ExitChan = make(chan int)
	t.producterMgr = NewClientManager()
	t.consumerMgr = NewClientManager()

	switch client.ClientType() {
	case CLIENT_TYPE_PRODUCTER:
		t.producterMgr.AddClient(client)
	case CLIENT_TYPE_CONSUMER:
		t.consumerMgr.AddClient(client)
	default:
		return nil
	}
	return t
}

func (t *Topic) Name() string {
	return t.name
}

func (t *Topic) AddClient(client *Client) {
	switch client.ClientType() {
	case CLIENT_TYPE_PRODUCTER:
		t.producterMgr.AddClient(client)
	case CLIENT_TYPE_CONSUMER:
		t.consumerMgr.AddClient(client)
	}
}
<commit_msg>缓冲区大小改为1W条消息<commit_after>package conn

import (
	"sync"
	"time"

	"github.com/berkaroad/uuid"
)

type Topic struct {
	name         string
	MsgChan      chan *Message
	FailMsgChan  chan *Message
	ExitChan     chan int
	producterMgr *ClientManager
	consumerMgr  *ClientManager
}

func NewTopic(name string, client *Client) *Topic {
	t := new(Topic)
	t.name = name
	t.MsgChan = make(chan *Message, 10000)
	t.FailMsgChan = make(chan *Message, 10000)
	t.ExitChan = make(chan int)
	t.producterMgr = NewClientManager()
	t.consumerMgr = NewClientManager()

	switch client.ClientType() {
	case CLIENT_TYPE_PRODUCTER:
		t.producterMgr.AddClient(client)
	case CLIENT_TYPE_CONSUMER:
		t.consumerMgr.AddClient(client)
	default:
		return nil
	}
	return t
}

func (t *Topic) Name() string {
	return t.name
}

func (t *Topic) AddClient(client *Client) {
	switch client.ClientType() {
	case CLIENT_TYPE_PRODUCTER:
		t.producterMgr.AddClient(client)
	case CLIENT_TYPE_CONSUMER:
		t.consumerMgr.AddClient(client)
	}
}

{'fraction_non_alphanumeric': 0.1040520260130065, 'fraction_numerical': 0.009504752376188095, 'mean_word_length': 4.361930294906166, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7282781', 'n_tokens_mistral': 812, 'n_tokens_neox': 761, 'n_words': 164}