Documentation
¶
Index ¶
- type LocalQueue
- func (l *LocalQueue[T]) New(ctx context.Context, sessionID string) error
- func (l *LocalQueue[T]) Publish(ctx context.Context, sessionID string, event T) error
- func (l *LocalQueue[T]) PublishFromChan(ctx context.Context, sessionID string, events chan T) error
- func (l *LocalQueue[T]) Subscribe(ctx context.Context, sessionID string) chan T
- type Queue
- type RedisQueue
- func (r *RedisQueue[T]) New(ctx context.Context, sessionID string) error
- func (r *RedisQueue[T]) Publish(ctx context.Context, sessionID string, event T) error
- func (r *RedisQueue[T]) PublishFromChan(ctx context.Context, sessionID string, events chan T) error
- func (r *RedisQueue[T]) Subscribe(ctx context.Context, sessionID string) chan T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LocalQueue ¶
type LocalQueue[T any] struct { // contains filtered or unexported fields }
func NewLocalQueue ¶
func NewLocalQueue[T any]() *LocalQueue[T]
func (*LocalQueue[T]) New ¶
func (l *LocalQueue[T]) New(ctx context.Context, sessionID string) error
func (*LocalQueue[T]) Publish ¶
func (l *LocalQueue[T]) Publish(ctx context.Context, sessionID string, event T) error
func (*LocalQueue[T]) PublishFromChan ¶
func (l *LocalQueue[T]) PublishFromChan(ctx context.Context, sessionID string, events chan T) error
type RedisQueue ¶
type RedisQueue[T any] struct { // contains filtered or unexported fields }
func NewRedisQueue ¶
func NewRedisQueue[T any](redisClient redis.Cmdable, prefix string) *RedisQueue[T]
func (*RedisQueue[T]) New ¶
func (r *RedisQueue[T]) New(ctx context.Context, sessionID string) error
func (*RedisQueue[T]) Publish ¶
func (r *RedisQueue[T]) Publish(ctx context.Context, sessionID string, event T) error
Publish serializes the event to JSON and pushes it to the Redis list.
func (*RedisQueue[T]) PublishFromChan ¶
func (r *RedisQueue[T]) PublishFromChan(ctx context.Context, sessionID string, events chan T) error
Click to show internal directories.
Click to hide internal directories.