snapshot of https://github.com/centrifugal/centrifugo.git (master, 2026-09-16; blobs > 131072B omitted)
This commit is contained in:
19
internal/confighelpers/map_broker.go
Normal file
19
internal/confighelpers/map_broker.go
Normal file
@@ -0,0 +1,19 @@
|
||||
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,
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user