memory

package
v0.51.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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