domain

package
v0.13.2 Latest Latest
Warning

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

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

Documentation

Overview

Package domain provides a Bridge that forwards DDS samples between two Participant domains (Milestone 10 — Enterprise Services: Routing).

A domain bridge connects two isolated DDS domains, allowing topics published in one domain to be delivered in another. This is the canonical approach for cross-domain routing without a centralised broker.

src domain 0               dst domain 1
Publisher → [topic] → Subscriber → Bridge → Publisher → [topic] → Subscriber

Each bridged topic is forwarded unidirectionally from src to dst. For bidirectional bridging, create two Bridge instances with swapped src/dst.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bridge

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

Bridge forwards DDS samples from one participant (src) to another (dst) for each configured topic. Each topic gets one subscriber on src and one publisher on dst; a dedicated goroutine forwards samples between them.

Bridge is safe for concurrent use from multiple goroutines.

func New

func New(src, dst dds.Participant, opts Options) (*Bridge, error)

New creates a Bridge that will forward samples on opts.Topics from src to dst. It establishes subscribers on src and publishers on dst immediately so that no samples are lost once Bridge.Start is called.

Returns an error if any subscriber or publisher cannot be created (e.g. because src or dst is already closed).

func (*Bridge) Close

func (b *Bridge) Close() error

Close stops all forwarding goroutines and closes the bridged subscribers and publishers. It is safe to call Close multiple times.

func (*Bridge) Start

func (b *Bridge) Start()

Start launches one forwarding goroutine per bridged topic. Each goroutine reads samples from the src subscriber and writes them to the dst publisher until Close is called or either participant is closed.

Start is idempotent: calling it more than once has no effect.

type Options

type Options struct {
	// Topics lists the DDS topic names to bridge from src to dst.
	// An empty Topics list results in a Bridge that forwards nothing.
	Topics []string
	// QoS is applied to all bridged subscriber and publisher endpoints.
	// Zero value uses [dds.DefaultQoS].
	QoS dds.QoS
}

Options configures a Bridge.

Jump to

Keyboard shortcuts

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