Hi http4kers… What is the http4k way to deal with ...
# http4k
n
Hi http4kers… What is the http4k way to deal with applications that use objects that must be started & stopped, like background threads or database connection pools? Should handlers be startable/stoppable, or AutoCloseable? But they they aren’t “servers as a function” any more. Or should startable/stoppable things be created outside the handler function and passed in? But in that case, how do you avoid having to test the main method that constructs and passes them into the handler function, which is an admirable goal of the “server as a function” model? Any guidance from http4k guru’s?