func (ch *ConsistentHash) Assignments(items ...string) map[string][]string {
	ch.mu.RLock()
	defer ch.mu.RUnlock()

	output := make(map[string][]string)
	for _, item := range items {
		bucket := ch.assignmentUnsafe(item)
		output[bucket] = append(output[bucket], item)
	}
	return output
}
// Assignments returns the assignments for a given list of items organized
// by the name of the bucket, and an array of the assigned items.
//
// Calling `Assignments` is safe to do concurrently and acquires
// a read lock on the consistent hash reference.
Assignments returns the assignments for a given list of items organized
by the name of the bucket, and an array of the assigned items.

Calling `Assignments` is safe to do concurrently and acquires
a read lock on the consistent hash reference.
// Assignments returns the assignments for a given list of items organized // by the name of the bucket and an array of the assigned items . // // Calling ` Assignments ` is safe to do concurrently and acquires // a read lock on the consistent hash reference .
func (ch *ConsistentHash) Assignments(items ...string) map[string][]string {
	ch.mu.RLock()
	defer ch.mu.RUnlock()
	output := make(map[string][]string)
	for _, item := range items {
		bucket := ch.assignmentUnsafe(item)
		output[bucket] = append(output[bucket], item)
	}
	return output
}
func ( ch * ConsistentHash ) Assignments ( items ... string ) map [ string ] [ ] string { ch . mu . RLock ( ) defer ch . mu . RUnlock ( ) output := make ( map [ string ] [ ] string ) for _ , item := range items { bucket := ch . assignmentUnsafe ( item ) output [ bucket ] = append ( output [ bucket ] , item ) } return output }
Assignments returns the assignments for a given list of items organized
by the name of the bucket, and an array of the assigned items.
Assignments returns the assignments for a given list of items organized by the name of the bucket and an array of the assigned items .