Chains offer an amazing opportunity for parallalelization, since unless a call to "thru" is encountered (or a function accepts the whole input), all calls can be parallelized. Right now, when I execute the following:
>>> py_(range(5)).map(time.sleep).for_each(lambda _: datetime.now()).value()
[datetime.datetime(2023, 8, 16, 13, 22, 11, 875152),
datetime.datetime(2023, 8, 16, 13, 22, 11, 875152),
datetime.datetime(2023, 8, 16, 13, 22, 11, 875152),
datetime.datetime(2023, 8, 16, 13, 22, 11, 875152),
datetime.datetime(2023, 8, 16, 13, 22, 11, 875152)]
Where as I believe that the following output would also be quite possible:
>>> py_(range(5)).map(time.sleep).for_each(lambda _: datetime.now()).value()
[datetime.datetime(2023, 8, 16, 13, 22, 11, 875152),
datetime.datetime(2023, 8, 16, 13, 22, 12, 875152),
datetime.datetime(2023, 8, 16, 13, 22, 13, 875152),
datetime.datetime(2023, 8, 16, 13, 22, 14, 875152),
datetime.datetime(2023, 8, 16, 13, 22, 15, 875152)]
Chains offer an amazing opportunity for parallalelization, since unless a call to "thru" is encountered (or a function accepts the whole input), all calls can be parallelized. Right now, when I execute the following:
Where as I believe that the following output would also be quite possible: