GracefullyStoppable

Interface for components that support graceful shutdown.

Implementations of this interface provide both synchronous and asynchronous graceful stop operations. The synchronous stop method has a default timeout of 30 seconds; if shutdown does not complete within that window, the call returns without guaranteeing all in-flight operations have finished. Use stop with a custom Duration to adjust the timeout, or call stopGracefully directly for fully asynchronous shutdown.

This is particularly useful for message dispatchers, connection pools, and other resources that need to complete in-flight operations before terminating.

See also

for the standard close contract

Inheritors

Functions

Link copied to clipboard
open override fun close()

Closes this resource by performing a graceful shutdown with a 30-second timeout.

Link copied to clipboard
open fun stop()

Synchronously stops this resource with a 30-second timeout.

open fun stop(timeout: Duration)

Synchronously stops this resource within the specified timeout.

Link copied to clipboard
abstract fun stopGracefully(): Mono<Void>

Asynchronously closes this resource with graceful shutdown.