Thanks everyone! I'm a little ambivalent on startAsync/stopAsync vs sync. Either way works, just differently, I may leave the startAsync alone but add an awaitTerminated on the stop. Thanks for the tip on the ScheduledExecutorService but I'm not sure it buys me much as the Guava Scheduling services has some nice additions that make writing a simple HealthCheck easy.
On Friday, November 2, 2018 at 12:56:05 PM UTC-7, Ryan Kennedy wrote: > > On Fri, Nov 2, 2018 at 12:45 PM Steve Kradel <[email protected] > <javascript:>> wrote: > >> Your approach seems like a sound one, and Dropwizard is essentially >> silent on the how/why of background threads, scheduling, etc. >> > > That's not entirely true. Have a look at the "Managed Objects" section of > the documentation, where you'll find reference to the Environment class' > ability to provide managed [Scheduled]ExecutorService instances… > > https://www.dropwizard.io/1.3.5/docs/manual/core.html#managed-objects > > >> A possible consideration is that you might prefer DW to fail fast and >> exit on service non-start rather than "run unhealthy" in connection with >> startAsync. >> > > A problem with failing fast and exiting on service non-start comes up with > databases. If the database is down do you want your dropwizard service to > also be down? If it's down there's no option to return a degraded response. > Also your dropwizard service will crash loop even though there's nothing > wrong with the service itself. > -- You received this message because you are subscribed to the Google Groups "dropwizard-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
