MCPcopy Create free account
hub / github.com/ActiveState/code / produce

Function produce

recipes/Python/475216_Bounded_Buffer_Example_1/recipe-475216.py:63–70  ·  view source on GitHub ↗
(run_flag, queue, send)

Source from the content-addressed store, hash-verified

61
62# called by the producer thread
63def produce(run_flag, queue, send):
64 while run_flag[0]:
65 # simulate production
66 sleep(random())
67 # put widget in buffer
68 item = Widget()
69 queue.put(item)
70 send.push(item)
71
72# called by the consumer thread
73def consume(run_flag, queue, recv, producer):

Callers

nothing calls this directly

Calls 5

sleepFunction · 0.85
randomFunction · 0.85
WidgetClass · 0.70
putMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected