MCPcopy Index your code
hub / github.com/nutsdb/nutsdb / wmStartReceiver

Function wmStartReceiver

watch_manager_test.go:191–203  ·  view source on GitHub ↗

wmStartReceiver starts a goroutine that receives messages from a channel Returns a pointer to track the received count

(t *testing.T, receiveChan <-chan *Message, expectBucket, expectKey string, received *int, wg *sync.WaitGroup)

Source from the content-addressed store, hash-verified

189// wmStartReceiver starts a goroutine that receives messages from a channel
190// Returns a pointer to track the received count
191func wmStartReceiver(t *testing.T, receiveChan <-chan *Message, expectBucket, expectKey string, received *int, wg *sync.WaitGroup) {
192 wg.Add(1)
193 go func() {
194 defer wg.Done()
195 for msg := range receiveChan {
196 assert.Equal(t, expectBucket, msg.BucketName)
197 assert.Equal(t, expectKey, msg.Key)
198 assert.NotNil(t, msg.Value)
199 assert.Equal(t, DataSetFlag, msg.Flag)
200 *received++
201 }
202 }()
203}
204
205func TestWatchManager_SubscribeAndSendMessage(t *testing.T) {
206 t.Run("subscribe and send message", func(t *testing.T) {

Calls 2

AddMethod · 0.45
DoneMethod · 0.45

Tested by

no test coverage detected