Open kpreid opened 1 month ago
take an existing YieldProgress and wrap it so that progress information is routed to additional destinations.
A wrinkle with doing this is that if we naïvely allow replacing the existing progress function, this will reveal the current range endpoints. So, the new YieldProgress
must have its range reset to 0..1, and we must create a wrapper on the existing progress function to preserve the range mapping it was already using.
An application might want to take an existing
YieldProgress
and wrap it so that progress information is routed to additional destinations. Currently, there is no way to do this without heap-allocating anotherYielding
, and failing to propagate the yield-pointLocation
information. To avoid this, there should be a function which allows cloning the yielding configuration from an existingYieldProgress
— or possibly cloning everything by default, perhaps written likeYieldProgress::to_builder()
.This could also be used internally by
YieldProgress::split_evenly_concurrent()
, which currently uses crate-private functions to get the same result.