Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddOnPipe ¶
func AddOnPipe[X, Y any](q <-chan struct{}, f func(X) Y, in <-chan X) chan Y
AddOnPipe 通用管道节点:接收X类型输入,通过函数f转换为Y类型,输出到Y通道;支持通过quit通道终止 参数:
q: 终止信号通道(关闭时组件退出) f: 数据转换函数(业务逻辑由外部注入,组件不关心具体实现) in: 输入通道(接收X类型数据)
返回:
输出通道(发送Y类型数据)
func FanIn ¶
func FanIn[X any](q <-chan struct{}, inputs ...<-chan X) chan X
FanIn 多通道合并:将多个<-chan X类型的输入通道,合并到一个chan X输出通道
Types ¶
type Broadcast ¶
type Broadcast[X any] struct { // contains filtered or unexported fields }
Broadcast 广播组件:将输入通道in的消息广播到所有订阅的输出通道
func NewBroadcast ¶
NewBroadcast 初始化广播组件
Click to show internal directories.
Click to hide internal directories.