PyDocs

Nav

Concurrent Execution

concurrent_tee

threading

function · Added in 3.15 (source) not WASI
  • concurrent_tee(iterable, n=2)
Variant of itertools.tee() but with guaranteed threading semantics.

Takes a non-threadsafe iterator as an input and creates concurrent
tee objects for other threads to have reliable independent copies of
the data stream.

The new iterators are only thread-safe if consumed within a single thread.
To share just one of the new iterators across multiple threads, wrap it
with threading.serialize_iterator().
0 Examples
No examples for threading/concurrent_tee.
See Also
No see-alsos for threading/concurrent_tee
0 Notes
No notes for concurrent_tee