Documentation ¶
Index ¶
- Variables
- func PullFor[T any](ctx context.Context, app App, key string, done <-chan struct{}, ...)
- func SubscribeFor[T any](ctx context.Context, app App, channel string, handler func(T, error)) func(context.Context) error
- type App
- func (a App) Delete(ctx context.Context, keys ...string) error
- func (a App) Exclusive(ctx context.Context, name string, timeout time.Duration, ...) (acquired bool, err error)
- func (a App) Load(ctx context.Context, key string) (string, error)
- func (a App) Ping() error
- func (a App) Publish(ctx context.Context, channel string, value any) error
- func (a App) Pull(ctx context.Context, key string, done <-chan struct{}, ...)
- func (a App) Push(ctx context.Context, key string, value any) error
- func (a App) Store(ctx context.Context, key string, value any, duration time.Duration) error
- func (a App) Subscribe(ctx context.Context, channel string) (<-chan *redis.Message, func(context.Context) error)
- type Config
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoSubscriber = errors.New("no subscriber for channel")
ErrNoSubscriber occurs when a published message is not received by any subscriber
Functions ¶
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App of package
func New ¶
func New(config Config, prometheusRegisterer prometheus.Registerer, tracer trace.Tracer) App
New creates new App from Config
func (App) Exclusive ¶
func (a App) Exclusive(ctx context.Context, name string, timeout time.Duration, action func(context.Context) error) (acquired bool, err error)
Exclusive get an exclusive lock for given name during duration
func (App) Pull ¶ added in v4.44.0
func (a App) Pull(ctx context.Context, key string, done <-chan struct{}, handler func(string, error))
Pull tasks from a list
Click to show internal directories.
Click to hide internal directories.