snapshot of https://github.com/ThreeDotsLabs/watermill.git (master, 2026-09-15; blobs > 131072B omitted)
Some checks failed
master / ci (push) Failing after 0s

This commit is contained in:
upstream-mirror
2026-09-15 21:27:46 +05:00
commit ce933d1277
538 changed files with 46504 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
package gochannel_test
import (
"testing"
"github.com/ThreeDotsLabs/watermill/pubsub/gochannel"
"github.com/ThreeDotsLabs/watermill/pubsub/tests"
"github.com/ThreeDotsLabs/watermill"
"github.com/ThreeDotsLabs/watermill/message"
)
func BenchmarkSubscriber(b *testing.B) {
tests.BenchSubscriber(b, func(n int) (message.Publisher, message.Subscriber) {
pubSub := gochannel.NewGoChannel(
gochannel.Config{OutputChannelBuffer: int64(n)}, watermill.NopLogger{},
)
return pubSub, pubSub
})
}
func BenchmarkSubscriberPersistent(b *testing.B) {
tests.BenchSubscriber(b, func(n int) (message.Publisher, message.Subscriber) {
pubSub := gochannel.NewGoChannel(
gochannel.Config{
OutputChannelBuffer: int64(n),
Persistent: true,
},
watermill.NopLogger{},
)
return pubSub, pubSub
})
}