exchange

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

README

Exchange Helpers

Convenience functions that orchestrate broadcast and unicast communication patterns over a network.Router using correlation IDs and CBOR encoding.

Notes

  • Correlation IDs are namespaced with :BROADCAST and :UNICAST internally to avoid collisions.
  • Messages are strongly typed by callers and serialized/deserialized via CBOR.
  • Underlying routing and quorum information come from the provided Router.

Documentation

Overview

Package exchange provides convenience functions that orchestrate broadcast and unicast communication patterns over a network.Router using correlation IDs and CBOR encoding.

See README.md for details.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Broadcast

func Broadcast[B any](rt *network.Router, correlationID string, broadcastMessageOut B) (broadcastMessagesIn network.RoundMessages[B], err error)

Broadcast performs an echo-broadcast round with the given message.

func Exchange

func Exchange[B any, U any](rt *network.Router, correlationID string, broadcastMessageOut B, unicastMessagesOut network.RoundMessages[U]) (broadcastMessagesIn network.RoundMessages[B], unicastMessagesIn network.RoundMessages[U], err error)

Exchange performs a combined broadcast and unicast exchange under a shared correlation ID.

func Unicast

func Unicast[U any](rt *network.Router, correlationID string, unicastMessagesOut network.RoundMessages[U]) (unicastMessagesIn network.RoundMessages[U], err error)

Unicast performs a unicast-only exchange where each party sends distinct messages.

Types

This section is empty.

Jump to

Keyboard shortcuts

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