added queue optimizations and depth monitoring.
This commit is contained in:
+3
-3
@@ -18,7 +18,7 @@ func TestRunQueue(t *testing.T) {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
|
||||
go RunQueue(id, ctx, inChan, outChan, 0, &atomic.Uint64{})
|
||||
go RunQueue(id, ctx, inChan, outChan, 0, &atomic.Uint64{}, &atomic.Int64{})
|
||||
|
||||
inChan <- types.ReceivedMessage{Data: []byte("hello"), ReceivedAt: time.Now()}
|
||||
|
||||
@@ -50,7 +50,7 @@ func TestRunQueue(t *testing.T) {
|
||||
}
|
||||
}()
|
||||
|
||||
go RunQueue(id, ctx, inChan, gatedInbox, 2, &atomic.Uint64{})
|
||||
go RunQueue(id, ctx, inChan, gatedInbox, 2, &atomic.Uint64{}, &atomic.Int64{})
|
||||
|
||||
// send three messages while the gated inbox is blocked
|
||||
inChan <- types.ReceivedMessage{Data: []byte("first"), ReceivedAt: time.Now()}
|
||||
@@ -88,7 +88,7 @@ func TestRunQueue(t *testing.T) {
|
||||
|
||||
done := make(chan struct{})
|
||||
go func() {
|
||||
RunQueue(id, ctx, inChan, outChan, 0, &atomic.Uint64{})
|
||||
RunQueue(id, ctx, inChan, outChan, 0, &atomic.Uint64{}, &atomic.Int64{})
|
||||
close(done)
|
||||
}()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user