MCPcopy Index your code
hub / github.com/coder/coder / NewMsgQueue

Function NewMsgQueue

coderd/database/pubsub/pubsub.go:77–89  ·  view source on GitHub ↗
(ctx context.Context, l Listener, le ListenerWithErr)

Source from the content-addressed store, hash-verified

75}
76
77func NewMsgQueue(ctx context.Context, l Listener, le ListenerWithErr) *MsgQueue {
78 if l == nil && le == nil {
79 panic("l or le must be non-nil")
80 }
81 q := &MsgQueue{
82 ctx: ctx,
83 cond: sync.NewCond(&sync.Mutex{}),
84 l: l,
85 le: le,
86 }
87 go q.run()
88 return q
89}
90
91func (q *MsgQueue) run() {
92 for {

Callers 5

Test_MsgQueue_ListenerFunction · 0.92
Test_MsgQueue_FullFunction · 0.92
SubscribeMethod · 0.85
SubscribeWithErrMethod · 0.85

Calls 1

runMethod · 0.95

Tested by 3

Test_MsgQueue_ListenerFunction · 0.74
Test_MsgQueue_FullFunction · 0.74