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 ClockOps in ResponseTiming Middleware #7163

Merged
merged 3 commits into from
Jun 15, 2023

Conversation

danicheg
Copy link
Member

No description provided.

@mergify mergify bot added series/0.23 PRs targeting 0.23.x module:server labels Jun 15, 2023
@@ -43,12 +44,9 @@ object ResponseTiming {
headerName: CIString = ci"X-Response-Time",
)(implicit F: Sync[F], clock: Clock[F]): HttpApp[F] =
Copy link
Member

Choose a reason for hiding this comment

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

Sync extends Clock, so including both is ambiguous.

Copy link
Member Author

Choose a reason for hiding this comment

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

I can do this refactoring too 👍🏻

Copy link
Member Author

Choose a reason for hiding this comment

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

But wait. What's about MiMa?

Copy link
Member

@armanbilge armanbilge Jun 15, 2023

Choose a reason for hiding this comment

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

Come on, you know the drill 😛

@deprecated
def apply[F[_]](
  http: HttpApp[F],
  timeUnit: TimeUnit,
  headerName: CIString,
  F: Sync[F],
  clock: Clock[F]
) = ???

Copy link
Member Author

Choose a reason for hiding this comment

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

mehhhhh!

Copy link
Member Author

Choose a reason for hiding this comment

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

okay, touche 😞

Copy link
Member

Choose a reason for hiding this comment

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

Actually, why do we even need Sync here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Functor + Clock should work well if you wanna get purity at max 😄

Copy link
Member Author

Choose a reason for hiding this comment

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

Have we beaten all the dragons?

Copy link
Member

@armanbilge armanbilge left a comment

Choose a reason for hiding this comment

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

Thanks, huge difference!

@danicheg danicheg merged commit 8e1ff9e into http4s:series/0.23 Jun 15, 2023
16 checks passed
@danicheg danicheg deleted the ResponseTiming-middleware branch June 15, 2023 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module:server series/0.23 PRs targeting 0.23.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants