Shutdown class Null safety

Random shutdown component that crashes the process using various methods.

The component is usually used for testing, but brave developers can try to use it in production to randomly crash microservices. It follows the concept of "Chaos Monkey" popularized by Netflix.

Configuration parameters

  • mode: null - crash by NullPointer excepiton, zero - crash by dividing by zero, excetion = crash by unhandled exception, exit - exit the process
  • min_timeout: minimum crash timeout in milliseconds (default: 5 mins)
  • max_timeout: maximum crash timeout in milliseconds (default: 15 minutes)

Example

var shutdown = Shutdown();
shutdown.configure(ConfigParams.fromTuples([
    "mode": "exception"
]));
shutdown.shutdown();         // Result: Bang!!! the process crashes
Implemented types

Constructors

Shutdown()
Creates a new instance of the shutdown component.

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

close(String? correlationId) Future
Closes component and frees used resources. [...]
override
configure(ConfigParams config) → void
Configures component by passing configuration parameters. [...]
override
isOpen() bool
Checks if the component is opened. [...]
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
open(String? correlationId) Future
Opens the component. [...]
override
shutdown() → void
Crashes the process using the configured crash mode.
toString() String
A string representation of this object. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited