Help us shape the future of Go! Take the 2026 Go Developer Survey

memory

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package memory provides explicit local ephemeral fan-out for pub/sub contracts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

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

Backend owns a bounded number of local subscriptions. It starts no goroutines, does not share process-global state, and never becomes a Redis failure fallback.

func New

func New(maxSubscriptions int) (*Backend, error)

New constructs a local backend with a positive subscription capacity.

func (*Backend) Close

func (b *Backend) Close() error

Close ends all local subscriptions with pubsub.ErrClosed and rejects further operations.

func (*Backend) FoundryAdapter

func (*Backend) FoundryAdapter(frameworkadapter.Seal)

FoundryAdapter marks the backend as framework-owned adapter I/O.

func (*Backend) Publish

func (b *Backend) Publish(ctx context.Context, channel pubsub.Channel, data []byte) (uint64, error)

Publish queues data for matching local subscriptions and returns their count. A subscription whose buffer overflows terminates instead of silently dropping messages.

func (*Backend) Subscribe

func (b *Backend) Subscribe(ctx context.Context, channels []pubsub.Channel, limits pubsub.Limits) (pubsub.Stream, error)

Subscribe creates a ready local stream over the exact channels. Capacity exhaustion returns fault.Overloaded.

Jump to

Keyboard shortcuts

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