Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bucket ¶
type Bucket interface { // Push Insert the elements to the bucket,return bucket length // If the exception occurs, it returns an error Push(v interface{}) (int, error) // Pop Pop an element // If the exception occurs, it returns an error Pop() (interface{}, error) // Len Get bucket length Len() int // ToSlice Get all the elements of the slice // If the exception occurs, it returns an error ToSlice() ([]interface{}, error) // Reset Empty bucket elements Reset() // Clone Get bucket duplicate Clone() Bucket // CloneAndReset Get bucket duplicate and empty elements CloneAndReset() Bucket }
Bucket Concurrent storage container element
func NewListBucket ¶
func NewListBucket() Bucket
NewListBucket Based on the list container implementation bucket
type BucketGroup ¶
type BucketGroup interface { // Open Open the bucket group waits to receive bucket // If already open,it returns an error Open() (<-chan Bucket, error) // Push Insert the elements to the bucket group // If the exception occurs, it returns an error Push(v interface{}) error // Len Get current use bucket length Len() int // Close Close bucket group,stop receive data // If the exception occurs, it returns an error Close() error }
BucketGroup Concurrent storage elements to the bucket group return to a specified number of a single bucket
func NewBucketGroup ¶
func NewBucketGroup(popBucketElementCount int, bucketPoolsNum ...int) BucketGroup
NewBucketGroup Create instances of BucketGroup popBucketElementCount The number of pop-up bucket required elements bucketPoolsNum The number of buckets within the group
Click to show internal directories.
Click to hide internal directories.