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

Method Close

queue/queue.go:159–176  ·  view source on GitHub ↗

Close 关闭消息队列

()

Source from the content-addressed store, hash-verified

157
158// Close 关闭消息队列
159func (q *queue) Close() {
160 if q.isClosed() {
161 return
162 }
163 q.mu.Lock()
164 for topic, ch := range q.chanSubs {
165 if ch.isClose == 0 {
166 ch.high <- &Message{}
167 ch.low <- &Message{}
168 q.chanSubs[topic] = &chanSub{isClose: 1}
169 }
170 }
171 q.mu.Unlock()
172 q.done <- struct{}{}
173 close(q.done)
174 atomic.StoreInt32(&q.isClose, 1)
175 qlog.Info("queue module closed")
176}
177
178func (q *queue) chanSub(topic string) *chanSub {
179 q.mu.Lock()

Callers

nothing calls this directly

Calls 4

isClosedMethod · 0.95
UnlockMethod · 0.80
LockMethod · 0.65
InfoMethod · 0.65

Tested by

no test coverage detected