Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToString ¶ added in v1.2.9
BytesToString converts byte slice to a string without memory allocation.
Note it may break if the implementation of string or slice header changes in the future go versions.
func CeilToPowerOfTwo ¶
CeilToPowerOfTwo returns the least power of two integer value greater than or equal to n.
func FloorToPowerOfTwo ¶
FloorToPowerOfTwo returns the greatest power of two integer value less than or equal to n.
func IsPowerOfTwo ¶
IsPowerOfTwo reports whether given integer is a power of two.
func StringToBytes ¶ added in v1.2.9
StringToBytes converts string to a byte slice without memory allocation.
Note it may break if the implementation of string or slice header changes in the future go versions.
Types ¶
type AsyncJobQueue ¶ added in v1.0.0
type AsyncJobQueue struct {
// contains filtered or unexported fields
}
AsyncJobQueue queues pending tasks.
func NewAsyncJobQueue ¶ added in v1.0.0
func NewAsyncJobQueue() AsyncJobQueue
NewAsyncJobQueue creates a note-queue.
func (*AsyncJobQueue) ForEach ¶ added in v1.0.0
func (q *AsyncJobQueue) ForEach() (err error)
ForEach iterates this queue and executes each note with a given func.
func (*AsyncJobQueue) Push ¶ added in v1.0.0
func (q *AsyncJobQueue) Push(job Job) (jobsNum int)
Push pushes a item into queue.