MCPcopy Index your code
hub / github.com/RustPython/RustPython / feed

Method feed

Lib/test/test_queue.py:838–847  ·  view source on GitHub ↗
(self, q, seq, rnd, sentinel)

Source from the content-addressed store, hash-verified

836 self.q = self.type2test()
837
838 def feed(self, q, seq, rnd, sentinel):
839 while True:
840 try:
841 val = seq.pop()
842 except IndexError:
843 q.put(sentinel)
844 return
845 q.put(val)
846 if rnd.random() > 0.5:
847 time.sleep(rnd.random() * 1e-3)
848
849 def consume(self, q, results, sentinel):
850 while True:

Calls 4

popMethod · 0.45
putMethod · 0.45
randomMethod · 0.45
sleepMethod · 0.45

Tested by

no test coverage detected