NAME
Async::Redis::Iterator - Cursor-based SCAN iterator
SYNOPSIS
my $iter = $redis->scan_iter(match => 'user:*', count => 100);
while (my $batch = await $iter->next) {
for my $key (@$batch) {
say $key;
}
}
DESCRIPTION
Iterator provides async cursor-based iteration over Redis SCAN commands:
SCAN- iterate keysHSCAN- iterate hash field/value pairsSSCAN- iterate set membersZSCAN- iterate sorted set members and scores as a flat list
METHODS
next
my $batch = await $iter->next;
Return the next batch as an arrayref, or undef when the scan is complete and there are no elements in the final batch. Redis may return empty intermediate batches; those are returned as empty arrayrefs and are still truthy in Perl.
reset
$iter->reset;
Reset the cursor to zero so iteration can start again.
cursor
Return the current Redis cursor.
done
Return true after Redis has returned cursor 0.
BEHAVIOR
Returns batches of elements, not individual items
Cursor managed internally
nextreturnsundefwhen iteration is completeSafe during key modifications, but Redis may return duplicates or miss keys
countis a hint, not a guarantee