Iterate keys without one complete blocking listing
#SCAN returns a next cursor and a batch. Start at 0 and continue with each returned cursor until it returns 0 again. COUNT is a hint, not a fixed page size; batches can be empty and keys can repeat. Changing data has limited iteration guarantees. Avoid treating SCAN as deterministic result pagination.
Fragment
Native commands in one redis-cli session; # lines are explanatory, not commands. Examples use disposable ref:* keys.