package pipe

import "github.com/moby/buildkit/solver/internal/pipe"

Index

Types

type Pipe

type Pipe[Payload, Value any] struct {
	Sender              Sender[Payload, Value]
	Receiver            Receiver[Payload, Value]
	OnReceiveCompletion func()
	OnSendCompletion    func()
}

func New

func New[Payload, Value any](req Request[Payload]) *Pipe[Payload, Value]

func NewWithFunction

func NewWithFunction[Payload, Value any](f func(context.Context) (Value, error)) (*Pipe[Payload, Value], func())

type Receiver

type Receiver[Payload, Value any] interface {
	Receive() bool
	Cancel()
	Status() Status[Value]
	Request() Payload
}

type Request

type Request[Payload any] struct {
	Payload  Payload
	Canceled bool
}

type Sender

type Sender[Payload, Value any] interface {
	Request() Request[Payload]
	Update(v Value)
	Finalize(v Value, err error)
	Status() Status[Value]
}

type Status

type Status[Value any] struct {
	Canceled  bool
	Completed bool
	Err       error
	Value     Value
}

Source Files

pipe.go

Version
v0.19.0
Published
Jan 20, 2025
Platform
js/wasm
Imports
4 packages
Last checked
9 minutes ago

Tools for package owners.