ShutdownController class

Tracks the state of a graceful shutdown.

Constructors

ShutdownController({required ShutdownConfig config, required FutureOr<void> onShutdown(), required FutureOr<void> onDrain(), required FutureOr<void> onForceClose()})
Creates a ShutdownController.

Properties

config → ShutdownConfig
The graceful-shutdown configuration.
final
done → Future<void>
Completes when shutdown has finished.
no setter
hashCode → int
The hash code for this object.
no setterinherited
isClosed → bool
Whether shutdown has completed and resources are closed.
no setter
isDraining → bool
Whether graceful shutdown is currently draining requests.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
triggerSignal → ProcessSignal?
The process signal that initiated shutdown, when one exists.
no setter
wasForced → bool
Whether shutdown was forced before the grace period elapsed.
no setter

Methods

dispose() → void
Creates a ShutdownController.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
trigger([ProcessSignal? signal]) → Future<void>
Creates a ShutdownController.
watchSignals([void onTriggered(ProcessSignal signal)?]) → void
Creates a ShutdownController.

Operators

operator ==(Object other) → bool
The equality operator.
inherited