epilogue_hooks

Attribute Macro epilogue_hooks 

Source
#[epilogue_hooks]
Expand description

Executes multiple specified functions after the main handler function.

This attribute macro configures multiple post-execution hooks that run after the main function logic. The main function will execute first, followed by the specified hook functions in the order provided.

ยงUsage

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

#[send]
async fn epilogue_handler1(ctx: Context) {
    // First post-execution logic
}

#[flush]
async fn epilogue_handler2(ctx: Context) {
    // Second post-execution logic
}

#[epilogue_hooks(epilogue_handler1, epilogue_handler2)]
async fn main_handler(ctx: Context) {
    // Main function logic (runs before epilogue_handler1 and epilogue_handler2)
}

The macro accepts a comma-separated list of function names as parameters. All hook functions and the main function must accept a Context parameter. Avoid combining this macro with other macros on the same function to prevent macro expansion conflicts.