MCPcopy
hub / github.com/redis/redis-py / sscan_iter

Method sscan_iter

redis/commands/core.py:6041–6058  ·  view source on GitHub ↗

Make an iterator using the SSCAN command so that the client doesn't need to remember the cursor position. ``match`` allows for filtering the keys by pattern ``count`` allows for hint the minimum number of returns

(
        self,
        name: KeyT,
        match: Union[PatternT, None] = None,
        count: Optional[int] = None,
    )

Source from the content-addressed store, hash-verified

6039 return self.execute_command("SSCAN", *pieces)
6040
6041 def sscan_iter(
6042 self,
6043 name: KeyT,
6044 match: Union[PatternT, None] = None,
6045 count: Optional[int] = None,
6046 ) -> Iterator:
6047 """
6048 Make an iterator using the SSCAN command so that the client doesn't
6049 need to remember the cursor position.
6050
6051 ``match`` allows for filtering the keys by pattern
6052
6053 ``count`` allows for hint the minimum number of returns
6054 """
6055 cursor = "0"
6056 while cursor != 0:
6057 cursor, data = self.sscan(name, cursor=cursor, match=match, count=count)
6058 yield from data
6059
6060 @overload
6061 def hscan(

Callers 3

cmds_generic.pyFile · 0.45
test_sscan_iterMethod · 0.45
test_sscan_iterMethod · 0.45

Calls 1

sscanMethod · 0.95

Tested by 2

test_sscan_iterMethod · 0.36
test_sscan_iterMethod · 0.36