shutdown 0.2.0 copy "shutdown: ^0.2.0" to clipboard
shutdown: ^0.2.0 copied to clipboard

outdatedDart 1 only

Prioritized events for graceful shutdown in server Dart applications.

example/shutdown.dart

import 'dart:async';

import 'package:shutdown/shutdown.dart';

Future main() async {
  registerDefaultProcessSignals();

  final db = await _acquireDB();
  addShutdownHandler(() => db.close());

  // [do you stuff]

  // call it at the end, this is a successful exit
  await shutdown();
}

Future _acquireDB() async => null; // TODO: implement
8
likes
0
pub points
73%
popularity

Publisher

verified publisheragilord.com

Prioritized events for graceful shutdown in server Dart applications.

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on shutdown