pipe

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package iopipe simplifies the process of pumping data from one end to another while allowing us to measure throughput.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Float64Metric

type Float64Metric func(i float64)

Int64Metric defines what we will use to produce/inform int64 metrics.

type Pipe

type Pipe struct {
	AMetric Float64Metric
	BMetric Float64Metric
	// contains filtered or unexported fields
}

Pipe will ensure that data flows from A to B and vice-versa - being A and B instances of io.ReadWriteCloser.

func New

New will create a new Pipe, copying data from A to B and vice-versa.

func (*Pipe) Run

func (p *Pipe) Run(ctx context.Context) error

Run will block and to piping until one of the three conditions is met:

  • 1: context is canceled
  • 2: A is closed
  • 3: B is closed

Jump to

Keyboard shortcuts

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