multiplex

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package multiplex implements client-side multiplexing helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Streaming

func Streaming[ResponseT any](ctx context.Context, nodes []string, initiate func(context.Context) (grpc.ServerStreamingClient[ResponseT], error)) <-chan Response[*ResponseT]

Streaming initiates a multiplexed streaming gRPC client call to multiple nodes.

func Unary

func Unary[ResponseT any](ctx context.Context, nodes []string, initiate func(context.Context) (*ResponseT, error)) <-chan Response[*ResponseT]

Unary initiates a multiplexed unary gRPC client call to multiple nodes.

Types

type Response

type Response[ResponseT any] struct {
	Node    string
	Payload ResponseT
	Err     error
}

Response represents a multiplexed response from a specific node.

Jump to

Keyboard shortcuts

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