Files
upstream-mirror b352a9a30d
Some checks failed
test / Lint (push) Failing after 3s
test / Test with Go 1.26.8 (push) Failing after 2s
snapshot of https://github.com/centrifugal/centrifugo.git (master, 2026-09-16; blobs > 131072B omitted)
2026-09-16 01:17:21 +05:00

20 lines
734 B
Go

package confighelpers
import (
"github.com/centrifugal/centrifugo/v6/internal/configtypes"
"github.com/centrifugal/centrifuge"
)
// CentrifugeRedisMapBroker creates a centrifuge.RedisMapBroker from config types.
func CentrifugeRedisMapBroker(n *centrifuge.Node, prefix string, shards []*centrifuge.RedisShard, cfg configtypes.RedisMapBrokerCommon) (*centrifuge.RedisMapBroker, error) {
return centrifuge.NewRedisMapBroker(n, centrifuge.RedisMapBrokerConfig{
Shards: shards,
Prefix: prefix,
CleanupInterval: cfg.CleanupInterval.ToDuration(),
CleanupBatchSize: cfg.CleanupBatchSize,
IdempotentResultTTL: cfg.IdempotentResultTTL.ToDuration(),
SkipPubSub: cfg.SkipPubSub,
})
}