MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / wait_for_command

Method wait_for_command

tests/flow/test_effects.py:37–51  ·  view source on GitHub ↗
(self, cmd, timeout=500)

Source from the content-addressed store, hash-verified

35 pass
36
37 def wait_for_command(self, cmd, timeout=500):
38 # wait for monitor to receive cmd
39 found = False
40 interval = 0.2
41
42 while not found and timeout > 0:
43 while len(self.monitor) == 0:
44 # wait for an item
45 time.sleep(interval)
46 timeout -= interval
47 item = self.monitor.pop()
48 found = cmd in item['command']
49
50 if found is False:
51 raise Exception(f"missing expected replicated command: {cmd}")
52
53 def wait_for_effect(self):
54 self.wait_for_command('GRAPH.EFFECT')

Callers 2

wait_for_effectMethod · 0.95
wait_for_queryMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected