shmem

package
v0.52.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package shmem provides a cross-process shared-memory transport for same-host DDS communication. Two processes on the same machine can publish and subscribe to topics with zero UDP round-trips: the publisher writes to a memory-mapped file and notifies the subscriber via a Unix domain socket; the subscriber reads directly from the same mapping.

The shmem transport implements dds.Participant so it is a drop-in replacement for the mock or rtps packages when all parties are on the same host.

Build constraints: mmap-backed operation is supported on Linux and macOS. On all other platforms the transport falls back to a file-based implementation that still eliminates the UDP network stack overhead.

Usage:

p, err := shmem.New(dds.Domain(0))

All participants in the same process and domain share one participant (backed by a process-scoped in-memory broker) and the shared-memory rendez-vous directory for cross-process delivery.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(domain dds.Domain) (dds.Participant, error)

New returns a dds.Participant backed by the shared-memory transport. Participants in the same process share an in-process broker (no file I/O for same-process delivery). Cross-process delivery uses a memory-mapped file and a Unix domain socket for signalling.

func NewLoaningPublisher added in v0.19.0

func NewLoaningPublisher(p dds.Participant, topic string, qos dds.QoS, bufSize int) (dds.LoaningPublisher, error)

NewLoaningPublisher creates a LoaningPublisher for topic using the given QoS. bufSize is the maximum sample size the pool will pre-allocate; pass 0 for the pool default (4096 bytes).

Types

This section is empty.

Jump to

Keyboard shortcuts

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