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

Reinstate examples #2139

Merged
merged 4 commits into from
Oct 2, 2018
Merged

Reinstate examples #2139

merged 4 commits into from
Oct 2, 2018

Conversation

aeons
Copy link
Member

@aeons aeons commented Sep 30, 2018

Fixes #2107

Updated and re-enabled all the example projects.
There's less inheritance now, and everything should use F[_] all the way up to IOApp.

The examples are not 100% consistent with each other.

I updated the push support syntax to operate on Response[F] instead of F[Response[F]], to be in line with the syntax on response and request. I did not add a deprecated copy of the old behaviour. I can add that if you guys want it.

Copy link
Member

@rossabaker rossabaker left a comment

Choose a reason for hiding this comment

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

This is nice. I think there's still room for improvement, but it's most important to get these back in business.

@@ -37,6 +38,6 @@ object ClientMultipartPostExample extends IOApp with Http4sClientDsl[IO] {
def run(args: List[String]): IO[ExitCode] =
BlazeClientBuilder[IO](global).resource
.use(go)
.flatMap(s => IO(println))
.flatMap(s => IO(println(s)))
Copy link
Member

Choose a reason for hiding this comment

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

😳

@@ -19,7 +19,7 @@ class GitHubService[F[_]: Sync](client: Client[F]) extends Http4sClientDsl[F] {

private val RedirectUri = s"http://localhost:8080/$ApiVersion/login/github"

final case class AccessTokenResponse(access_token: String)
case class AccessTokenResponse(access_token: String)
Copy link
Member

Choose a reason for hiding this comment

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

I like the final on case classes. It doesn't matter much here, but it's a good habit.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, me too, but this one doesn't compile if it's final :)


logger.trace(s"Adding push resource: $newUrl")
final class PushOps[F[_]: Functor](response: Response[F]) extends AnyRef {
Copy link
Member

Choose a reason for hiding this comment

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

Yes, this change makes a lot more sense.

@rossabaker rossabaker merged commit 57c08bf into http4s:master Oct 2, 2018
@aeons aeons deleted the reinstate-examples branch October 2, 2018 20:07
rossabaker added a commit to http4s/http4s-servlet that referenced this pull request Apr 3, 2022
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