MCPcopy Create free account
hub / github.com/apple/foundationdb / run_threads

Function run_threads

layers/pubsub/pubsub_example.py:91–103  ·  view source on GitHub ↗
(feed_map, inbox_map, messages)

Source from the content-addressed store, hash-verified

89
90# Generate and run a thread for each feed and each inbox.
91def run_threads(feed_map, inbox_map, messages):
92 feed_threads = [threading.Thread(target=feed_driver, args=(feed_map[id], messages))
93 for id in feed_map]
94 inbox_threads = [threading.Thread(target=inbox_driver, args=(inbox_map[id],))
95 for id in inbox_map]
96 for f in feed_threads:
97 f.start()
98 for i in inbox_threads:
99 i.start()
100 for f in feed_threads:
101 f.join()
102 for i in inbox_threads:
103 i.join()
104
105
106def sample_pubsub(feeds, inboxes, messages):

Callers 1

sample_pubsubFunction · 0.70

Calls 3

ThreadMethod · 0.80
startMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected