Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add methods to timeout on pulls #2845

Merged
merged 7 commits into from
Jan 20, 2024
Merged

Add methods to timeout on pulls #2845

merged 7 commits into from
Jan 20, 2024

Conversation

bplommer
Copy link
Contributor

No description provided.

@bplommer bplommer marked this pull request as ready for review March 10, 2022 17:16
core/shared/src/main/scala/fs2/Stream.scala Outdated Show resolved Hide resolved
F: Temporal[F]
): Pull[F, O2, Unit] =
timed { timedPull =>
def go(timedPull: Pull.Timed[F, O]): Pull[F, O2, Unit] =
Copy link
Contributor

Choose a reason for hiding this comment

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

Both timed { timedPull => and go(timedPull have the same name. I would prefer to avoid name collision here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's intentional to prevent the outer timedPull from being referenced inside go.

Copy link
Contributor

@nikiforo nikiforo Jun 28, 2022

Choose a reason for hiding this comment

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

Got it. We can write it this way as well:

def timeoutWith = {
  def go(timedPull: Pull.Timed[F, O]): Pull[F, O2, Unit] = ???
  timed(go)
}

@diesalbla
Copy link
Contributor

@bplommer Could you rebase on top of current main branch? Just so it is up to date before merging.

@bplommer
Copy link
Contributor Author

bplommer commented Jan 7, 2024

@diesalbla I've rebased this on main, sorry for the long delay!

@mpilquist mpilquist merged commit d3c6900 into typelevel:main Jan 20, 2024
12 of 14 checks passed
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.

5 participants