http4s / http4s-servlet

http4s-servlet support
Apache License 2.0
6 stars 5 forks source link

Unable to change the timeout when using mountService in ServletContextSyntax.scala #12

Closed marcdanie closed 1 year ago

marcdanie commented 6 years ago

Comment from @rossabaker
Oh, I see the problem https://github.com/http4s/http4s/blob/master/servlet/src/main/scala/org/http4s/servlet/syntax/ServletContextSyntax.scala We're setting the timeout there, but not passing it through as a param. That's bad design.

rossabaker commented 6 years ago

@marcdanie Did you end up with a workaround that you'd like to submit as a PR? Or should I try to come up with something? I'd like to do better here.

rossabaker commented 3 years ago

I think this just needs a timeout parameter with a default value. The mountService method is an old name as well -- mountRoutes would probably be more sensible.

yuferpegom commented 2 years ago

Hello @rossabaker, is this still open? I can work on it if it is. My understanding is that we just need to add a param with a default value and update the name of the method right?

rossabaker commented 2 years ago

@yuferpegom Thanks for volunteering! Yes, that sounds like the correct approach for mountService, which we can deprecate.

Doing it for mountHttpApp is harder: we can't add a default parameter without breaking binary compatibility, and mountService calls mountHttpApp. We can do this on the main branch today like you describe, but we'll need to think of a new name if we want to backport to series/0.22.

yuferpegom commented 2 years ago

Hello @rossabaker . So just to double-check we are on the same page. We can just deprecate mountService and then create a new mountRoutes method that will receive a timeout that uses a default value. As for the mountHttpApp I'm not following you, you mean we can add the default param for this version and merge it to main but eventually, we'd need to also create a new method and deprecate this one? If so, we can just do it now right?

Thanks!

rossabaker commented 2 years ago

Wow, servlet went from getting no attention to a few PRs today! I'll comment on your PR. Probably easier where there's code to talk about.

yuferpegom commented 2 years ago

I have created a new PR against series/0.23, please take a look when you have a chance and thanks!

valencik commented 1 year ago

@rossabaker should this be closed as completed in https://github.com/http4s/http4s/pull/6037 ?

rossabaker commented 1 year ago

Yep!