Documentation
¶
Index ¶
- Variables
- func Exit() <-chan struct{}
- func NewDispatch[T any]() *dispatch[T]
- func Register(uniqID string, batchSize int, AutoCommitDuration time.Duration, ...) error
- func Release()
- func Submit(key string, value any)
- func Unregister(uniqID any)
- func UnregisterAll()
- type DuplicateUniqId
- type HandleBatch
- type HandleSingle
- type Handler
- type Option
- type Task
- type Worker
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidUniqid = errors.New("invalid key") ErrDispatchExit = errors.New("dispatch exit") ErrContextCancel = errors.New("context cancel") ErrWorkerExit = errors.New("worker exit") ErrWorkerShutdown = errors.New("worker shutdown") ErrWorkerContextCancel = errors.New("worker context cancel") ErrExceedRetrys = errors.New("exceed retrys") )
View Source
var DefaultDispatch = NewDispatch[any]()
Functions ¶
func NewDispatch ¶
func NewDispatch[T any]() *dispatch[T]
func Unregister ¶
func Unregister(uniqID any)
func UnregisterAll ¶
func UnregisterAll()
Types ¶
type DuplicateUniqId ¶
type DuplicateUniqId struct {
// contains filtered or unexported fields
}
func (DuplicateUniqId) Error ¶
func (e DuplicateUniqId) Error() string
type HandleBatch ¶
type HandleSingle ¶
type Option ¶
type Option[T any] interface { // contains filtered or unexported methods }
func WithRetrys ¶
Click to show internal directories.
Click to hide internal directories.