package
Version:
v0.18.1
Opens a new window with list of versions in this module.
Published: Dec 4, 2024
License: Apache-2.0
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
type Pipe[Payload, Value any] struct {
Sender Sender[Payload, Value]
Receiver Receiver[Payload, Value]
OnReceiveCompletion func()
OnSendCompletion func()
}
func New[Payload, Value any](req Request[Payload]) *Pipe[Payload, Value]
type Receiver[Payload, Value any] interface {
Receive() bool
Cancel()
Status() Status[Value]
Request() Payload
}
type Request[Payload any] struct {
Payload Payload
Canceled bool
}
type Sender[Payload, Value any] interface {
Request() Request[Payload]
Update(v Value)
Finalize(v Value, err error)
Status() Status[Value]
}
type Status[Value any] struct {
Canceled bool
Completed bool
Err error
Value Value
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.