//misk-service/misk/ReadyService
ReadyService¶
[jvm]\ @Singleton
class ReadyService@Injectconstructor : AbstractIdleService
This is a symbolic service that’s useful to define the relationship, generally, between services which process traffic (Jetty, SQS, Kinesis, Cron, Tasks, etc.) and services which are required to do work (Database, Redis, GCP, Feature Flags).
By having the former depend on ReadyService and the latter enhanced by ReadyService we can force, for example, JettyService to stop before our feature flag service without having to intertwine our dependency graph.
Example
install(
ServiceModule<TransacterService>(qualifier)
.enhancedBy<SchemaMigratorService>(qualifier)
// ReadyService won't run until TransacterService is complete
.enhancedBy<ReadyService>()
.dependsOn<DataSourceService>(qualifier)
)
Constructors¶
ReadyService | [jvm] @Inject constructor() |
Types¶
Name | Summary |
---|---|
Companion | [jvm] object Companion |
Functions¶
Name | Summary |
---|---|
addListener | [jvm] override fun addListener(listener: Service.Listener, executor: Executor) |
awaitRunning | [jvm] override fun awaitRunning() override fun awaitRunning(timeout: Duration) override fun awaitRunning(timeout: Long, unit: TimeUnit) |
awaitTerminated | [jvm] override fun awaitTerminated() override fun awaitTerminated(timeout: Duration) override fun awaitTerminated(timeout: Long, unit: TimeUnit) |
failureCause | [jvm] override fun failureCause(): Throwable |
isRunning | [jvm] override fun isRunning(): Boolean |
startAsync | [jvm] @CanIgnoreReturnValue override fun startAsync(): Service |
state | [jvm] override fun state(): Service.State |
stopAsync | [jvm] @CanIgnoreReturnValue override fun stopAsync(): Service |
toString | [jvm] open override fun toString(): String |