Discover Packages
github.com/adamcolton/luce
ds
channel
package
Version:
v0.0.0-...-157c9c8
Opens a new window with list of versions in this module.
Published: Apr 26, 2024
License: GPL-3.0
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
func Slice[T any ](s []T, ch chan<- T) (out chan T)
func Timeout[T any ](ms int , ch <-chan T) (t T, err error )
type Close struct {
OnClose chan Close
}
type Merge[T any ] struct {
MaxDelayMS uint
SingleDelayUS uint
}
func NewMerge[T any ](rcv <-chan []T, snd chan<- []T) (m *Merge [T], retSnd chan<- []T, retRcv <-chan []T)
func (m *Merge [T]) Cycle(buf []T)
Cycle receives on In and combines all the slices it recevies and sends them
to Out. It will receive for a maximum of MaxDelayMS or if it goes
SingleDelayUS without receiving anything.
Run invokes Cycle everytime data is received on In. This adds at least
SingleDelayUS latentcy.
type Pipe[T any ] struct {
Rcv <-chan T
Snd chan<- T
}
Pipe holds a pair of channels. It is intended for embedding.
func NewPipe[T any ](rcv <-chan T, snd chan<- T) (pipe Pipe [T], retSnd chan<- T, retRcv <-chan T)
type Writer struct {
Ch chan<- []byte
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.