Documentation
¶
Index ¶
- func NewRedisStreamClient(redisClient redis.UniversalClient, serviceName string) types.RedisStreamClient
- type RecoverableRedisStreamClient
- func (r *RecoverableRedisStreamClient) Claim(ctx context.Context, mutexKey string) error
- func (r *RecoverableRedisStreamClient) Done() error
- func (r *RecoverableRedisStreamClient) ID() string
- func (r *RecoverableRedisStreamClient) Init(ctx context.Context) (<-chan notifs.RecoverableRedisNotification[any], error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRedisStreamClient ¶
func NewRedisStreamClient(redisClient redis.UniversalClient, serviceName string) types.RedisStreamClient
NewRedisStreamClient creates a new RedisStreamClient
This function creates a new RedisStreamClient with the given redis client and stream name Stream is the name of the stream to read from where actual data is transmitted
Types ¶
type RecoverableRedisStreamClient ¶
type RecoverableRedisStreamClient struct {
// contains filtered or unexported fields
}
RecoverableRedisStreamClient is an implementation of the RedisStreamClient interface
func (*RecoverableRedisStreamClient) Claim ¶
func (r *RecoverableRedisStreamClient) Claim(ctx context.Context, mutexKey string) error
Claim claims pending messages from a stream
func (*RecoverableRedisStreamClient) Done ¶
func (r *RecoverableRedisStreamClient) Done() error
Done marks the end of processing for a client
func (*RecoverableRedisStreamClient) ID ¶
func (r *RecoverableRedisStreamClient) ID() string
ID returns the consumer name that uniquely identifies the consumer
func (*RecoverableRedisStreamClient) Init ¶
func (r *RecoverableRedisStreamClient) Init(ctx context.Context) (<-chan notifs.RecoverableRedisNotification[any], error)
Init initializes the RedisStreamClient
This function initializes the RedisStreamClient by enabling keyspace notifications for expired events, subscribing to expired events, and starting a blocking read on the LBS stream Returns a channel to read messages from the LBS stream. The client should read from this channel and process the messages. Returns a channel to read keyspace notifications. The client should read from this channel and process the notifications.