GenericIdleService

abstract class GenericIdleService : AbstractIdleService

Abstract base class that wraps Guava's AbstractIdleService with Kotlin Duration-based synchronous start and stop methods.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

Functions

Link copied to clipboard
fun addListener(listener: Service.Listener?, executor: Executor?)
Link copied to clipboard
fun awaitRunning(timeout: Duration?)
fun awaitRunning(timeout: Long, unit: TimeUnit?)
Link copied to clipboard
fun awaitTerminated(timeout: Duration?)
fun awaitTerminated(timeout: Long, unit: TimeUnit?)
Link copied to clipboard
Link copied to clipboard

Creates a Service.Listener for this Service that logs all lifecycle transitions (starting, running, stopping, terminated, failed) using the provided logger.

Link copied to clipboard
@CanIgnoreReturnValue
fun startAsync(): Service?
Link copied to clipboard
fun startSync(maxWait: Duration = 15.seconds)

Starts the service asynchronously and blocks until it is running or the timeout expires.

Link copied to clipboard
fun state(): Service.State?
Link copied to clipboard
@CanIgnoreReturnValue
fun stopAsync(): Service?
Link copied to clipboard
fun stopSync(maxWait: Duration = 15.seconds)

Stops the service asynchronously and blocks until it has terminated or the timeout expires.