1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-29 17:41:15 +03:00

Merge branch 'master' into v9

Signed-off-by: monkey92t <golang@88.com>
This commit is contained in:
monkey92t
2021-06-01 11:21:13 +08:00
5 changed files with 423 additions and 147 deletions

View File

@ -443,4 +443,23 @@ var _ = Describe("PubSub", func() {
Fail("timeout")
}
})
It("should ChannelMessage", func() {
pubsub := client.Subscribe(ctx, "mychannel")
defer pubsub.Close()
ch := pubsub.Channel(
redis.WithChannelSize(10),
redis.WithChannelHealthCheckInterval(time.Second),
)
text := "test channel message"
err := client.Publish(ctx, "mychannel", text).Err()
Expect(err).NotTo(HaveOccurred())
var msg *redis.Message
Eventually(ch).Should(Receive(&msg))
Expect(msg.Channel).To(Equal("mychannel"))
Expect(msg.Payload).To(Equal(text))
})
})