import pypeln as pl
import time
from random import random
def slow_integer_pair(x):
time.sleep(random()) # <= some slow computation
if x == 0:
yield x
else:
yield x
yield -x
data = range(10) # [0, 1, 2, ..., 9]
stage = pl.sync.flat_map(slow_integer_pair, data, workers=3, maxsize=4)
list(stage) # [0, 1, -1, 2, -2, ..., 9, -9]
Expected behavior
No TypeError
Library Info
Please provide os info and elegy version.
Ubuntu: 16.04
Python: 3.9
Pypeln: 0.4.9
Screenshots
If applicable, add screenshots to help explain your problem.
Describe the bug Running your sync examples results in TypeError
Minimal code to reproduce Small snippet that contains a minimal amount of code. Source: https://cgarciae.github.io/pypeln/api/sync/Overview/
Expected behavior No TypeError
Library Info Please provide os info and elegy version. Ubuntu: 16.04 Python: 3.9 Pypeln: 0.4.9
Screenshots If applicable, add screenshots to help explain your problem.
Additional context