MCPcopy Create free account
hub / github.com/33cn/chain33 / chanSub

Method chanSub

queue/queue.go:178–191  ·  view source on GitHub ↗
(topic string)

Source from the content-addressed store, hash-verified

176}
177
178func (q *queue) chanSub(topic string) *chanSub {
179 q.mu.Lock()
180 defer q.mu.Unlock()
181 _, ok := q.chanSubs[topic]
182 if !ok {
183 q.chanSubs[topic] = &chanSub{
184 high: make(chan *Message, defaultChanBuffer),
185 low: make(chan *Message, defaultLowChanBuffer),
186 isClose: 0,
187 done: make(chan struct{}),
188 }
189 }
190 return q.chanSubs[topic]
191}
192
193func (q *queue) closeTopic(topic string) {
194 q.mu.Lock()

Callers 12

sendMethod · 0.95
sendAsynMethod · 0.95
sendLowTimeoutMethod · 0.95
TestChanSubCallbackFunction · 0.80
BenchmarkChanSubFunction · 0.80
BenchmarkChanSub2Function · 0.80
BenchmarkChanSub3Function · 0.80
BenchmarkChanSub4Function · 0.80
BenchmarkChanSubCallbackFunction · 0.80
WaitTimeoutMethod · 0.80
SubMethod · 0.80

Calls 2

UnlockMethod · 0.80
LockMethod · 0.65

Tested by 7

TestChanSubCallbackFunction · 0.64
BenchmarkChanSubFunction · 0.64
BenchmarkChanSub2Function · 0.64
BenchmarkChanSub3Function · 0.64
BenchmarkChanSub4Function · 0.64
BenchmarkChanSubCallbackFunction · 0.64