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
merged 1 commit into from May 15, 2019
Merged

Conversation

@diesalbla
Copy link
Contributor

@diesalbla diesalbla commented May 5, 2019

Use method Concurrent.timeoutTo.

http
.mapF(respF => F.race(respF, T.sleep(timeout) *> timeoutResponse))
.map(_.merge)
http.mapF(Concurrent.timeoutTo(_, timeout, timeoutResponse))
Copy link
Member

@SystemFw SystemFw May 5, 2019

Choose a reason for hiding this comment

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

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

Loading

Copy link
Contributor Author

@diesalbla diesalbla May 5, 2019

Choose a reason for hiding this comment

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

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

Loading

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

@rossabaker rossabaker May 15, 2019

Choose a reason for hiding this comment

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

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.

Loading

@rossabaker rossabaker merged commit dd87213 into http4s:master May 15, 2019
1 check passed
Loading
@diesalbla diesalbla deleted the timeout_mapf branch May 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants