memory

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MessageQueue

type MessageQueue[T any] struct {
	*Queue[T]
	*PubSub[T]
}

func NewMessageQueue

func NewMessageQueue[T any](opt ...Option) *MessageQueue[T]

func (*MessageQueue[T]) Close

func (p *MessageQueue[T]) Close() error

type Option

type Option func(*options)

func WithQueueSize

func WithQueueSize(size int) Option

type PubSub

type PubSub[T any] struct {
	// contains filtered or unexported fields
}

func NewPubSub

func NewPubSub[T any](opt ...Option) *PubSub[T]

func (*PubSub[T]) Broadcast

func (p *PubSub[T]) Broadcast(ctx context.Context, topic string, data T) error

func (*PubSub[T]) Close

func (p *PubSub[T]) Close() error

func (*PubSub[T]) Subscribe

func (p *PubSub[T]) Subscribe(ctx context.Context, topic string, handler func(data T) error) error

func (*PubSub[T]) UnsubscribeAll

func (p *PubSub[T]) UnsubscribeAll(ctx context.Context, topic string) error

type Queue

type Queue[T any] struct {
	// contains filtered or unexported fields
}

func NewQueue

func NewQueue[T any](opt ...Option) *Queue[T]

func (*Queue[T]) Close

func (q *Queue[T]) Close() error

func (*Queue[T]) Consume

func (q *Queue[T]) Consume(ctx context.Context, topic string) (T, error)

func (*Queue[T]) Publish

func (q *Queue[T]) Publish(ctx context.Context, topic string, data T) error

func (*Queue[T]) PurgeQueue

func (q *Queue[T]) PurgeQueue(ctx context.Context, topic string) error

type Subscription

type Subscription[T any] struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL