Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@adamgfraser
Copy link
Contributor

Resolves #4101.

combineWith takes a function to specify how to merge the intervals of two schedules, but it is always done if either schedule is done so to a certain extent it already embodies intersection semantics in that one schedule can no longer continue if the other one doesn't want to.

This PR renames combineWith to unionWith and implements a new combinator intersectWith that still takes a merge function but now continues as long as either schedule wants to continue. || can then be implements in terms of unionWith to make use cases like Schedule.recurWhile[Boolean](_ == true) || Schedule.fixed(1.second) work.

@adamgfraser adamgfraser requested a review from jdegoes August 19, 2020 15:24
@jdegoes
Copy link
Member

jdegoes commented Aug 19, 2020

Nice spot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

scheduleA || scheduleB completes unexpectedly when scheduleA is done

2 participants