pools

package
v0.6.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2021 License: BSD-3-Clause Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Buffer = NewByteBuffer(4, 64<<10)
View Source
var Bytes = NewByteSlice(32, 64<<10)
View Source
var TinyBytes = NewByteSlice(4, 128)

Functions

func AcquireTimer

func AcquireTimer(timeout time.Duration) *time.Timer

func AcquireWaitGroup

func AcquireWaitGroup() *sync.WaitGroup

func Go added in v0.1.1

func Go(f func())

func NewByteBuffer added in v0.1.4

func NewByteBuffer(min, max int) *byteBufferPool

NewByteBuffer creates new byteBufferPool that reuses objects which size is in logarithmic range [min, max].

Note that it is a shortcut for Custom() constructor with Options provided by WithLogSizeMapping() and WithLogSizeRange(min, max) calls.

func NewByteSlice added in v0.1.4

func NewByteSlice(min, max int) *byteSlicePool

New creates new byteSlicePool that reuses objects which size is in logarithmic range [min, max].

Note that it is a shortcut for Custom() constructor with Options provided by WithLogSizeMapping() and WithLogSizeRange(min, max) calls.

func ReleaseTimer

func ReleaseTimer(t *time.Timer)

func ReleaseWaitGroup

func ReleaseWaitGroup(wg *sync.WaitGroup)

func ResetTimer

func ResetTimer(t *time.Timer, period time.Duration)

Types

type ByteBuffer added in v0.1.4

type ByteBuffer struct {
	// contains filtered or unexported fields
}

func (*ByteBuffer) Append added in v0.2.6

func (bb *ByteBuffer) Append(data []byte)

func (*ByteBuffer) Bytes added in v0.1.4

func (bb *ByteBuffer) Bytes() *[]byte

func (ByteBuffer) Cap added in v0.2.6

func (bb ByteBuffer) Cap() int

func (*ByteBuffer) Copy added in v0.3.2

func (bb *ByteBuffer) Copy(data []byte)

func (*ByteBuffer) Fill added in v0.1.9

func (bb *ByteBuffer) Fill(data []byte, start, end int)

func (*ByteBuffer) Len added in v0.1.9

func (bb *ByteBuffer) Len() int

func (*ByteBuffer) Reset added in v0.1.4

func (bb *ByteBuffer) Reset()

func (*ByteBuffer) SetBytes added in v0.1.4

func (bb *ByteBuffer) SetBytes(b *[]byte)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL