mirror of
https://github.com/eosswedenorg/thalos
synced 2026-07-03 11:53:41 +02:00
redis/wrapper.go: Adding XAdd()
This commit is contained in:
parent
953113b456
commit
fb0ecce6c2
1 changed files with 12 additions and 0 deletions
|
|
@ -48,6 +48,18 @@ func Publish(channel string, message interface{}) (*_redis.IntCmd) {
|
||||||
return rdb.Publish(redisCtx, channel, message)
|
return rdb.Publish(redisCtx, channel, message)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func XAdd(stream string, id string, maxlen int64, message map[string]interface{}) (*_redis.StringCmd) {
|
||||||
|
|
||||||
|
args := &_redis.XAddArgs{
|
||||||
|
Stream: stream,
|
||||||
|
ID: id,
|
||||||
|
MaxLenApprox: maxlen,
|
||||||
|
Values: message,
|
||||||
|
}
|
||||||
|
|
||||||
|
return rdb.XAdd(redisCtx, args)
|
||||||
|
}
|
||||||
|
|
||||||
func RegisterPublish(channel string, message interface{}) (*_redis.IntCmd) {
|
func RegisterPublish(channel string, message interface{}) (*_redis.IntCmd) {
|
||||||
return redis_pipe.Publish(redisCtx, channel, message)
|
return redis_pipe.Publish(redisCtx, channel, message)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue