 
 ///
 /// Type alias for "Before flush" (i.e. before headers and body are written) lifecycle handler
-public typealias PreFlushLifecycleHandler = (request: RouterRequest, response: RouterResponse) -> Void
+public typealias LifecycleHandler = () -> Void

    var invokedSend = false

    //
    // Current pre-flush lifecycle handler
    //
    private var preFlush: PreFlushLifecycleHandler = {request, response in }

    ///
    /// Set of cookies to return with the response

    /// Sets the pre-flush lifecycle handler and returns the previous one
    ///
    /// - Parameter newPreFlush: The new pre-flush lifecycle handler
    public func setOnEndInvoked(_ newOnEndInvoked: LifecycleHandler) -> LifecycleHandler {
        let oldOnEndInvoked = onEndInvoked
        onEndInvoked = newOnEndInvoked
        return oldOnEndInvoked
    }


