perf: batch group unread fanout

This commit is contained in:
richjohnrambo
2026-09-27 23:10:28 +08:00
parent fc875cc84e
commit 6b8ed4a2cc
10 changed files with 260 additions and 4 deletions
+7
View File
@@ -392,6 +392,13 @@ func StartRealtimeFanoutSubscriber(ctx context.Context, nodeID string, handler f
return groupMsgRuntime.StartRealtimeFanoutSubscriber(ctx, nodeID, handler)
}
// RealtimeFanoutEnabled reports whether Redis Pub/Sub fanout is configured.
// Callers use it to retain the native routing fallback when Redis is disabled.
func RealtimeFanoutEnabled() bool {
runtime, ok := groupMsgRuntime.(*redisGroupMessageRuntime)
return ok && runtime != nil && runtime.cfg.GroupFanout
}
func CacheObject(tenantID types.TenantID, namespace, id string, value any) error {
if groupMsgRuntime == nil || !tenantID.IsValid() || namespace == "" || id == "" || value == nil {
return nil