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

Skip to content

Conversation

@svroonland
Copy link
Contributor

@svroonland svroonland commented Jul 11, 2020

Resolves #3863

In the current implementation every element is unnecessarily delayed by the updating of the schedule. The new implementation updates the schedule as part of the next pull.

One consequence when using Schedule.never is that in the new version, the stream emits at least 1 element, while in the old version it would not, although the effect was evaluated.

The new version has the same semantics as ZIO(..).repeat(schedule), which is to evaluate the effect once and then use the schedule to repeat.

@svroonland svroonland marked this pull request as ready for review July 12, 2020 09:33
@svroonland svroonland requested a review from iravid as a code owner July 12, 2020 09:33
@iravid
Copy link
Member

iravid commented Jul 15, 2020

@svroonland Your solution looks more correct to me! Thanks for opening this. Can you grab the tests from #3891 and add them here?

Copy link
Member

@iravid iravid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @svroonland!

@iravid iravid merged commit 0c50937 into zio:master Jul 16, 2020
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.

ZStream.tick does not run the action first before waiting the interval

2 participants