mirror of
https://github.com/eosswedenorg/thalos
synced 2026-08-31 21:08:14 +02:00
transport/publisher.go: pass ChannelInterface instead of string to Publish()
This commit is contained in:
parent
5202247200
commit
69a9e9f47d
4 changed files with 11 additions and 8 deletions
|
|
@ -3,6 +3,8 @@ package redis_pubsub
|
|||
import (
|
||||
"context"
|
||||
|
||||
"eosio-ship-trace-reader/transport"
|
||||
|
||||
redis "github.com/go-redis/redis/v8"
|
||||
)
|
||||
|
||||
|
|
@ -18,8 +20,8 @@ func New(client *redis.Client) *RedisPubsub {
|
|||
}
|
||||
}
|
||||
|
||||
func (r *RedisPubsub) Publish(channel string, payload []byte) error {
|
||||
return r.pipeline.Publish(r.ctx, channel, payload).Err()
|
||||
func (r *RedisPubsub) Publish(channel transport.ChannelInterface, payload []byte) error {
|
||||
return r.pipeline.Publish(r.ctx, channel.String(), payload).Err()
|
||||
}
|
||||
|
||||
func (r *RedisPubsub) Flush() error {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue