twitter / finatra

Fast, testable, Scala services built on TwitterServer and Finagle
https://twitter.github.io/finatra/
Apache License 2.0
2.27k stars 406 forks source link

Documentation for Lifecycle Incorrect? #489

Closed safi-manar closed 5 years ago

safi-manar commented 5 years ago

Hi,

I noticed that in the lifecycle startup documentation, Post Injector Startup occurs before Modules post injector startup

But, in the source code, I see a difference lifecycle sequence in com.twitter.inject.app.App.scala:

 def main(): Unit = {
    installedModules = loadModules()

    installedModules.postInjectorStartup()
    postInjectorStartup()

    info("Warming up.")
    warmup()
    beforePostWarmup()
    postWarmup()
    afterPostWarmup()
    installedModules.postWarmupComplete()
...

So, I'm wondering:

  1. Is the documentation out of date here / is this a mistake?
  2. Is there a guarantee for future releases that installedModules.postInjectorStartup() will precede postInjectorStartup()?
cacoco commented 5 years ago

@safi-manar thanks for the issue -- the code is correct and documentation just needs to be updated. We don't make guarantees to not change anything in the framework in a future release but we do try to not completely break backwards compatibility without a good reason. FWIW, I don't expect this lifecycle code to change anytime soon. Thanks!

safi-manar commented 5 years ago

@cacoco Awesome, thank you so much!

cacoco commented 5 years ago

@safi-manar the image should be correct now: http://twitter.github.io/finatra/user-guide/getting-started/lifecycle.html#startup. Thanks!