sync

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 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 InvalidationEvent

type InvalidationEvent = types.InvalidationEvent

InvalidationEvent is an alias for types.InvalidationEvent

type PubSubSynchronizer

type PubSubSynchronizer struct {
	// contains filtered or unexported fields
}

PubSubSynchronizer implements cache synchronization using Redis Pub/Sub.

func NewPubSubSynchronizer

func NewPubSubSynchronizer(client *redis.Client, channel, podID string) *PubSubSynchronizer

NewPubSubSynchronizer creates a new Pub/Sub synchronizer.

func (*PubSubSynchronizer) Close

func (ps *PubSubSynchronizer) Close() error

Close closes the synchronizer.

func (*PubSubSynchronizer) OnInvalidate

func (ps *PubSubSynchronizer) OnInvalidate(callback func(event InvalidationEvent))

OnInvalidate registers a callback for invalidation events.

func (*PubSubSynchronizer) Publish

func (ps *PubSubSynchronizer) Publish(ctx context.Context, event InvalidationEvent) error

Publish publishes an invalidation event.

func (*PubSubSynchronizer) Subscribe

func (ps *PubSubSynchronizer) Subscribe(ctx context.Context) error

Subscribe starts listening for invalidation events.

Jump to

Keyboard shortcuts

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