-
Notifications
You must be signed in to change notification settings - Fork 7
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
Conversation
@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]( |
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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]( |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😈
7878774
to
2a60131
Compare
This updates dependencies and add
blockTimer
which blocks and returns to an implicit timer and renames toblockShift
to be used generally.