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 blockTimer and rename to blockShift #19

Merged
merged 12 commits into from
May 31, 2018
Merged

Conversation

ChristopherDavenport
Copy link
Owner

This updates dependencies and add blockTimer which blocks and returns to an implicit timer and renames to blockShift to be used generally.

@deprecated("0.2.0", "Use blockShift instead.")
final def block[A](fa: F[A])(implicit F: Async[F], ec: ExecutionContext): F[A] =
final private[linebacker] def block[A](

Choose a reason for hiding this comment

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

why do you need this at all when RC2 isn't compatible with cats 0.10?

_ <- Async.shift(eEC)
a <- Applicative[F].pure(aE).rethrow
endEC <- select(end)
a <- Async[F].bracket(Async.shift[F](iEC))(_ => fa)(_ => Async.shift(endEC))

Choose a reason for hiding this comment

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

so this is like the third time I see this. I think this is pointing to the need of either some package object or object definition of something like:

private[linebacker] final def dualShift[F[_], A](initialEc: ExecutionContext, endEc: ExecutionContext, action: F[A])(implicit F: Async[F]) = 
  F.bracket(Async.shift[F](initialEc))(_ => fa)(_ => Async.shift[F](encEc))

Then just calling dualShift(ec1, ec2, fa) in different modules and you save all the copypasta.

private[linebacker] def blockingPool: ExecutionContext = blockingContext

@deprecated("0.2.0", "Use blockShift instead.")
final private[linebacker] def block[A](

Choose a reason for hiding this comment

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

just because I got trolled, what's the point in only deprecating and just just outright removing when you don't need bincompat for 0.2 yet?

Copy link

@jmcardon jmcardon left a comment

Choose a reason for hiding this comment

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

😈

@ChristopherDavenport ChristopherDavenport merged commit ce9225d into master May 31, 2018
@ChristopherDavenport ChristopherDavenport deleted the blockTimer branch May 31, 2018 03:09
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.

2 participants