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

Use Concurrent timeoutTo method. #2553

merged 1 commit into from May 15, 2019


Copy link

commented May 5, 2019

Use method Concurrent.timeoutTo.

.mapF(respF => F.race(respF, T.sleep(timeout) *> timeoutResponse))
http.mapF(Concurrent.timeoutTo(_, timeout, timeoutResponse))

This comment has been minimized.

Copy link

SystemFw May 5, 2019


you should be able to use syntax for the Concurrent op, _.timeoutTo(timeout, response)

This comment has been minimized.

Copy link

diesalbla May 5, 2019

Author Contributor

Thought about that before the PR. IMHO, this is simple enough, and small enough, not to make it worth another syntax import.

import cats.effect._
import cats.implicits._
import cats.effect.{Concurrent, Timer}
import cats.syntax.applicative._

This comment has been minimized.

Copy link

rossabaker May 15, 2019


I still don't like these imports, but I'm planning to do a passthrough to undo some of the damage IntelliJ has done, so I'll clean up then.

@rossabaker rossabaker merged commit dd87213 into http4s:master May 15, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed

@diesalbla diesalbla deleted the diesalbla:timeout_mapf branch May 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.