Skip to content

Commit 396c874

Browse files
authored
Add support for post shutdown function (#251)
1 parent 8b87e40 commit 396c874

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/builders/module.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,19 @@ impl ModuleBuilder {
126126
self
127127
}
128128

129+
/// Sets the post request shutdown function for the extension.
130+
///
131+
/// This function can be useful if you need to do any final cleanup at the
132+
/// very end of a request, after all other resources have been released. For
133+
/// example, if your extension creates any persistent resources that last
134+
/// beyond a single request, you could use this function to clean those up. # Arguments
135+
///
136+
/// * `func` - The function to be called when shutdown is requested.
137+
pub fn post_deactivate_function(mut self, func: extern "C" fn() -> i32) -> Self {
138+
self.module.post_deactivate_func = Some(func);
139+
self
140+
}
141+
129142
/// Sets the extension information function for the extension.
130143
///
131144
/// # Arguments

0 commit comments

Comments
 (0)