epilogue_hook

Attribute Macro epilogue_hook 

Source
#[epilogue_hook]
Expand description

Executes a specified function after the main handler function.

This attribute macro configures a post-execution hook that runs after the main function logic. The main function will execute first, followed by the specified hook function.

ยงUsage

use hyperlane::*;
use hyperlane_macros::*;

#[send]
async fn epilogue_handler(ctx: Context) {
    // Post-execution logic
}

#[epilogue_hook(epilogue_handler)]
async fn main_handler(ctx: Context) {
    // Main function logic (runs before epilogue_handler)
}

The macro accepts a function name as parameter. Both the hook function and main function must accept a Context parameter. Avoid combining this macro with other macros on the same function to prevent macro expansion conflicts.