Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultAsyncConcurrency = 1 DefaultAsyncChanLength = 100 )
View Source
const ( DefaultConsumerQueueLength = 1000 DefaultConsumerMaxMerge = 10 DefaultConsumerMaxDuration = time.Second )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsyncHandler ¶
type AsyncOption ¶
type AsyncOption func(pool *AsyncPool)
func WithAsyncChanLength ¶
func WithAsyncChanLength(chanLen int) AsyncOption
func WithAsyncComponent ¶
func WithAsyncComponent(component string) AsyncOption
func WithAsyncConcurrency ¶
func WithAsyncConcurrency(concurrency int) AsyncOption
type AsyncPool ¶
type AsyncPool struct {
// contains filtered or unexported fields
}
func NewAsync ¶
func NewAsync(handler AsyncHandler, opts ...AsyncOption) *AsyncPool
type ConsumerFunc ¶
func (ConsumerFunc) Handle ¶
func (fn ConsumerFunc) Handle(ctx context.Context, key interface{}, values []interface{})
type ConsumerOption ¶
type ConsumerOption func(slot *consumerSlot)
func WithConsumerChanLength ¶
func WithConsumerChanLength(chanLen int) ConsumerOption
func WithConsumerComponent ¶
func WithConsumerComponent(component string) ConsumerOption
func WithConsumerMaxDuration ¶
func WithConsumerMaxDuration(dur time.Duration) ConsumerOption
func WithConsumerMaxMerge ¶
func WithConsumerMaxMerge(length int) ConsumerOption
type ConsumerPool ¶
type ConsumerPool struct {
// contains filtered or unexported fields
}
func NewConsumer ¶
func NewConsumer(slotSize int, handler Consumer, opts ...ConsumerOption) *ConsumerPool
func (*ConsumerPool) Add ¶
func (pool *ConsumerPool) Add(key interface{}, value interface{}) bool
Click to show internal directories.
Click to hide internal directories.