memory

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemoryRealtimeBus

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

MemoryRealtimeBus is an in-process fan-out bus. Every subscriber to a topic receives a copy of every published message. It is single-node only and non-durable, which is exactly the right model for low-latency GraphQL subscriptions on a single engine instance.

func GetMemoryRealtimeBus

func GetMemoryRealtimeBus(_ *models.Config) (*MemoryRealtimeBus, error)

GetMemoryRealtimeBus returns an in-process realtime bus.

func (*MemoryRealtimeBus) Close

func (b *MemoryRealtimeBus) Close() error

Close marks the bus closed; subscriber channels close via their ctx.

func (*MemoryRealtimeBus) Publish

func (b *MemoryRealtimeBus) Publish(_ context.Context, topic string, payload []byte) error

Publish delivers payload to every active subscriber of topic (non-blocking).

func (*MemoryRealtimeBus) Subscribe

func (b *MemoryRealtimeBus) Subscribe(ctx context.Context, topic string) (<-chan []byte, error)

Subscribe registers a new subscriber channel for topic and removes it when ctx is cancelled.

func (*MemoryRealtimeBus) SubscribeReplay

func (b *MemoryRealtimeBus) SubscribeReplay(ctx context.Context, topic string, _ interfaces.ReplayPolicy) (<-chan []byte, error)

SubscribeReplay on the memory bus is a no-op alias of Subscribe (no durability).

Jump to

Keyboard shortcuts

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