IterBuffered returns a buffered iterator which could be used in a for range loop.
()
| 369 | |
| 370 | // IterBuffered returns a buffered iterator which could be used in a for range loop. |
| 371 | func (slm ShardLockMaps) IterBuffered() <-chan Tuple { |
| 372 | chanList := snapshot(slm) |
| 373 | total := 0 |
| 374 | for _, c := range chanList { |
| 375 | total += cap(c) |
| 376 | } |
| 377 | ch := make(chan Tuple, total) |
| 378 | go fanIn(chanList, ch) |
| 379 | return ch |
| 380 | } |
| 381 | |
| 382 | // Items returns all items as map[string]interface{} |
| 383 | func (slm ShardLockMaps) Items() map[string]interface{} { |