MCPcopy Index your code
hub / github.com/dabeaz/python-cookbook / consumer

Function consumer

src/12/polling_multiple_thread_queues/pqueue.py:39–47  ·  view source on GitHub ↗

Consumer that reads data on multiple queues simultaneously

(queues)

Source from the content-addressed store, hash-verified

37 import time
38
39 def consumer(queues):
40 '''
41 Consumer that reads data on multiple queues simultaneously
42 '''
43 while True:
44 can_read, _, _ = select.select(queues,[],[])
45 for r in can_read:
46 item = r.get()
47 print('Got:', item)
48
49 q1 = PollableQueue()
50 q2 = PollableQueue()

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected