iojoin

package
v1.15.1-beta.6 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Overview

iojoin provides a utility for joining two concurrent units of work that share resources. It is used to implement the duplex bridge between the caller's stdio and the exec's stdio.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Join

func Join(a, b Side, grace time.Duration, onFirst func()) (aErr, bErr error)

Join runs two sides concurrently and returns once both have completed or the slower side is abandoned after grace. The first side to complete fires the onFirst hook, which is where the caller should tear down shared resources (close pipe ends, cancel a context) so the straggler can finish naturally. The caller owns the resources and must close them; Join does not close any of its arguments.

Types

type Side

type Side func() error

Side is a concurrent, error-reporting unit of work that can be joined with another Side. It is expected to be run in its own goroutine.

Jump to

Keyboard shortcuts

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