A listener that will be called when the session is about to close.
typedef WillCloseListener = FutureOr<void> Function(Session session);