Documentation
¶
Overview ¶
Package syncx 并发编排原语(stdlib-only):按键在飞闸门 + 按序扇出收集。 收编自消费方手写形态——LLM 按模型名限在飞(429 风暴治理)与「按 index 写 结果免锁」的并行扇出样板。
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type KeyedGate ¶
type KeyedGate struct {
// contains filtered or unexported fields
}
KeyedGate 按键在飞上限闸门(并发安全;channel 令牌先到先得;键集由调用方 保证有界——如按模型名/租户名,键量级恒小不回收)。
func NewKeyedGate ¶
NewKeyedGate 构造;cap<=0 = 不限(Acquire 直通零开销)。
type Slot ¶ added in v0.5.0
type Slot[T any] struct { Val T // Err 正常错误,或 panic 收编的 *async.PanicError。 Err error // Panicked 历史兼容字段:panic 原始 payload。新代码改用 // errors.As(&async.PanicError) 读 Err。 // // Deprecated: v0.7.0 起由 Slot.Err 承载。 Panicked any }
Slot 是 FanInErr 的逐槽结果:Val/Err 为 fn 的正常返回;fn panic 时 Err 承载 *async.PanicError(errors.As 可辨、携带栈,#12)且 Val 为零值。 Panicked 保留原始 payload(兼容字段,Deprecated——改用 errors.As(Slot.Err))。
Click to show internal directories.
Click to hide internal directories.