//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 |
Properties¶
| Name | Summary |
|---|---|
| isRunning | [jvm] val isRunning: Boolean |
Functions¶
| Name | Summary |
|---|---|
| addListener | [jvm] fun addListener(listener: Service.Listener, executor: Executor) |
| awaitRunning | [jvm] fun awaitRunning() fun awaitRunning(timeout: Duration) fun awaitRunning(timeout: Long, unit: TimeUnit) |
| awaitTerminated | [jvm] fun awaitTerminated() fun awaitTerminated(timeout: Duration) fun awaitTerminated(timeout: Long, unit: TimeUnit) |
| failureCause | [jvm] fun failureCause(): Throwable |
| startAsync | [jvm] fun startAsync(): Service |
| state | [jvm] fun state(): Service.State |
| stopAsync | [jvm] fun stopAsync(): Service |
| toString | [jvm] open fun toString(): String |