This function handles cleanup tasks when a Shiny session ends. It ensures proper
resource disposal by logging the session end and closing database connections.
Usage
server_clean(session, logger, zone = "SURVEY")
Arguments
- session
The Shiny session object
- logger
A logger object with a log_message method for recording events
- zone
Character string specifying the logging zone (default: "SURVEY")
Value
None (called for side effects)
Details
The function performs the following cleanup tasks:
This function should be called within the server function of a Shiny application
to ensure proper resource management.
Examples
if (FALSE) { # \dontrun{
server <- function(input, output, session) {
# Setup logger
logger <- LoggerFactory$new()
# Register cleanup
server_clean(session, logger)
}
} # }