send_once_with_data

Attribute Macro send_once_with_data 

Source
#[send_once_with_data]
Expand description

Sends the complete response exactly once with data after function execution.

This attribute macro ensures that the response is sent exactly once to the client, preventing multiple response transmissions for single-use scenarios, with the specified data.

ยงUsage

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

#[send_once_with_data("One-time response")]
async fn send_once_with_data_handler(ctx: Context) {
    // Response is sent exactly once with the specified data after function returns
}

The macro accepts data to send and should be applied to async functions that accept a Context parameter.