Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BufferPool ¶
type BufferPool struct {
// contains filtered or unexported fields
}
BufferPool is a 'buffer pool'.
func NewBufferPool ¶
func NewBufferPool(baseline int) *BufferPool
NewBufferPool creates a new initialized 'buffer pool'.
func (*BufferPool) Get ¶
func (p *BufferPool) Get(n int) []byte
Get returns buffer with length of n.
func (*BufferPool) String ¶
func (p *BufferPool) String() string
type ChanBuffer ¶
type ChanBuffer[T any] struct { // contains filtered or unexported fields }
ChanBuffer 基于channel实现的缓冲区
func NewChanBuffer ¶
func NewChanBuffer[T any](fetcher ttypes.FetchHandler[T], resultLen int, timeout time.Duration) *ChanBuffer[T]
func (*ChanBuffer[T]) Close ¶
func (c *ChanBuffer[T]) Close()
func (*ChanBuffer[T]) Get ¶
func (c *ChanBuffer[T]) Get() (T, error)
type IBufferPool ¶
type ICacheBuffer ¶
func NewCacheBuffer ¶
func NewCacheBuffer[T any](fetcher ttypes.FetchHandler[T]) ICacheBuffer[T]
Click to show internal directories.
Click to hide internal directories.