Documentation ¶
Index ¶
- type Consumer
- func (c *Consumer[T]) AddOnClose(funs ...func()) *Consumer[T]
- func (c *Consumer[T]) AddOnConsume(funs ...func(T)) *Consumer[T]
- func (c *Consumer[T]) Log() *zap.SugaredLogger
- func (c *Consumer[T]) Name() string
- func (c *Consumer[T]) Push(inp T)
- func (c *Consumer[T]) Run()
- func (c *Consumer[T]) Start(wg ...*sync.WaitGroup)
- func (c *Consumer[T]) Stop()
- type FIFOQueue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Consumer ¶
type Consumer[T any] struct { // contains filtered or unexported fields }
func (*Consumer[T]) AddOnClose ¶
func (*Consumer[T]) AddOnConsume ¶
func (*Consumer[T]) Log ¶
func (c *Consumer[T]) Log() *zap.SugaredLogger
type FIFOQueue ¶
type FIFOQueue[T any] struct { // contains filtered or unexported fields }
FIFOQueue implements variable size synchronized FIFO queue
func (*FIFOQueue[T]) Close ¶
func (q *FIFOQueue[T]) Close()
Close closes FIFOQueue deferred until all elements are pull
func (*FIFOQueue[T]) CloseNow ¶
func (q *FIFOQueue[T]) CloseNow()
CloseNow closes FIFOQueue immediately. The elements in the buffer are lost
func (*FIFOQueue[T]) Consume ¶
func (q *FIFOQueue[T]) Consume(consumerFunctions ...func(elem T))
Consume reads all elements of the queue until it is closed
Click to show internal directories.
Click to hide internal directories.