Skip to content

Instantly share code, notes, and snippets.

@rossabaker
Last active June 24, 2022 05:00
Show Gist options
  • Save rossabaker/3d696ad20ece5e4838add46159472a38 to your computer and use it in GitHub Desktop.
Save rossabaker/3d696ad20ece5e4838add46159472a38 to your computer and use it in GitHub Desktop.
// httpApp and dispatcher are required
// asyncTimeout and chunkSize have defaults
// Builder[F[_]] with constructor args
AsyncHttp4sServlet
.builder[IO](httpApp, dispatcher)
.withAsyncTimeout(5.seconds)
.withChunkSize(4096)
.build
// Builder[F[_], State]
// No special syntax for required params
// State is a "phantom type"
// Implicit =:= on build to check required args were set
AsyncHttp4sServlet
.builder[IO]
.withHttpApp(httpApp)
.withDispatcher(dispatcher)
.withAsyncTimeout(5.seconds)
.withChunkSize(4096)
.build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment