Documentation ¶
Index ¶
- func ErrorGroupDiff(handlers []ttypes.ErrorGroupHandler, closeHandler ...ttypes.ErrHandler) error
- func ErrorGroupLimit(n int, handlers []ttypes.ErrorGroupHandler, closeHandler ...ttypes.ErrHandler) error
- func ErrorGroupSame(number int, handler ttypes.ErrorGroupHandler, ...) error
- func FanOut[T any](data ttypes.IFanOut[T], number int) []T
- func RunSafe(handler func(), errHandler ...ttypes.ErrHandler)
- func WaitGroupDiff(handlers []ttypes.WaitGroupHandler)
- func WaitGroupLimit(n int, handlers []ttypes.WaitGroupHandler)
- func WaitGroupSame(number int, handler ttypes.WaitGroupHandler)
- type Future
- type Limit
- type PriorityChan
- func (p *PriorityChan[T]) Get() T
- func (p *PriorityChan[T]) GetWithTimeout(timeout time.Duration) (T, error)
- func (p *PriorityChan[T]) HandleSignal(highHandler ttypes.PriorityHandler[T], lowHandler ttypes.PriorityHandler[T]) error
- func (p *PriorityChan[T]) Put(event T, t ttypes.PriorityType)
- func (p *PriorityChan[T]) PutWithTimeout(event T, t ttypes.PriorityType, timeout time.Duration) error
- func (p *PriorityChan[T]) TryGet() T
- func (p *PriorityChan[T]) TryPut(event T, t ttypes.PriorityType) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorGroupDiff ¶ added in v1.0.47
func ErrorGroupDiff(handlers []ttypes.ErrorGroupHandler, closeHandler ...ttypes.ErrHandler) error
func ErrorGroupLimit ¶ added in v1.0.47
func ErrorGroupLimit(n int, handlers []ttypes.ErrorGroupHandler, closeHandler ...ttypes.ErrHandler) error
func ErrorGroupSame ¶ added in v1.0.47
func ErrorGroupSame(number int, handler ttypes.ErrorGroupHandler, closeHandler ...ttypes.ErrHandler) error
func WaitGroupDiff ¶ added in v1.0.47
func WaitGroupDiff(handlers []ttypes.WaitGroupHandler)
func WaitGroupLimit ¶ added in v1.0.47
func WaitGroupLimit(n int, handlers []ttypes.WaitGroupHandler)
func WaitGroupSame ¶ added in v1.0.47
func WaitGroupSame(number int, handler ttypes.WaitGroupHandler)
Types ¶
type Limit ¶
type Limit struct {
// contains filtered or unexported fields
}
Limit 限制并发器,限制最大同时运行的数量
type PriorityChan ¶
type PriorityChan[T any] struct { // contains filtered or unexported fields }
func NewPriorityChan ¶
func NewPriorityChan[T any](hsize int, lsize int) *PriorityChan[T]
func (*PriorityChan[T]) GetWithTimeout ¶
func (p *PriorityChan[T]) GetWithTimeout(timeout time.Duration) (T, error)
GetWithTimeout 获取数据,支持超时返回
func (*PriorityChan[T]) HandleSignal ¶
func (p *PriorityChan[T]) HandleSignal(highHandler ttypes.PriorityHandler[T], lowHandler ttypes.PriorityHandler[T]) error
HandleSignal 通过传入处理函数,处理队列信号
func (*PriorityChan[T]) Put ¶ added in v0.0.3
func (p *PriorityChan[T]) Put(event T, t ttypes.PriorityType)
func (*PriorityChan[T]) PutWithTimeout ¶ added in v0.0.3
func (p *PriorityChan[T]) PutWithTimeout(event T, t ttypes.PriorityType, timeout time.Duration) error
func (*PriorityChan[T]) TryPut ¶ added in v0.0.3
func (p *PriorityChan[T]) TryPut(event T, t ttypes.PriorityType) error
Click to show internal directories.
Click to hide internal directories.