gpt4 book ai didi

Redis PUB/SUB : how to ignore own messages?

转载 作者:行者123 更新时间:2023-12-03 06:36:17 26 4
gpt4 key购买 nike

这个想法是:
我有 N 个 WCF 服务,它们连接并订阅了同一个 Redis 消息 channel 。这些服务使用此 channel 交换消息以同步一些缓存和其他数据。

每个服务如何忽略自己的消息? IE。如何发布给除我之外的所有人?

最佳答案

看起来 Redis PUB/SUB 不支持这种过滤。因此,解决方案是为每个发布者使用一组单独的 channel ,并为它们之间的订阅同步使用公共(public) channel 。这是 golang example of no-echo chat application .

关于Redis PUB/SUB : how to ignore own messages?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31179697/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com