Collects functions over a com.twitter.util.Closables.
Collects functions over a com.twitter.util.Closables. These functions will be passed to
the application onExit
function to be executed on graceful shutdown of the application.
A Function0 which returns Unit. It is expected that this function encapsulates awaiting on a com.twitter.util.Closable that the application would like to ensure is closed upon graceful shutdown.
closeOnExit {
val closable = ...
Await.result(
closable.close(after: Duration), timeout: Duration)
}
It is expected that the passed function is a function over a com.twitter.util.Closable.
com.twitter.util.Closable
com.twitter.util.Awaitable
=> Unit)
A Java-friendly method for creating a named Flag.
A Java-friendly method for creating a named Flag.
the name of the Flag.
a default value for the Flag when no value is given as an application argument.
the help text explaining the purpose of the Flag.
the created Flag.
A Java-friendly way to create a "mandatory" Flag.
A Java-friendly way to create a "mandatory" Flag. "Mandatory" flags MUST have a value provided as an application argument (as they have no default value to be used).
the name of the Flag.
the help text explaining the purpose of the Flag.
a string describing the type of the Flag, i.e.: Integer.
the created Flag.
Create a "mandatory" flag and add it to this Module's flags list."Mandatory" flags MUST have a value provided as an application argument (as they have no default value to be used).
Create a "mandatory" flag and add it to this Module's flags list."Mandatory" flags MUST have a value provided as an application argument (as they have no default value to be used).
must be a Flaggable type.
the name of the Flag.
the help text explaining the purpose of the Flag.
the created Flag.
Java users: see the more Java-friendly createFlag or createMandatoryFlag.
Create a Flag and add it to this Module's flags list.
Create a Flag and add it to this Module's flags list.
must be a Flaggable type.
the name of the Flag.
a default value for the Flag when no value is given as an application argument.
the help text explaining the purpose of the Flag.
the created Flag.
Java users: see the more Java-friendly createFlag or createMandatoryFlag.
Additional framework modules to be composed into this module
Additional framework modules to be composed into this module
Additional modules to be composed into this module
Additional modules to be composed into this module
NOTE: This Seq of modules is generally used instead of the standard Guice 'install' method so that TwitterModules with flag definitions can be supported.
However, AbstractModule.install can still be used for non-TwitterModules, and is sometimes preferred due to install being deferred until after flag parsing occurs.
Invoke after external ports are bound and any clients are resolved
Invoke after external ports are bound and any clients are resolved
This method should only get singleton instances from the injector.
Invoked on graceful shutdown of the application.
Invoked on graceful shutdown of the application.
This method should only get singleton instances from the injector.
Invoked after the injector is started.
Invoked after the injector is started.
This method should only get singleton instances from the injector.