flush

Attribute Macro flush 

Source
#[flush]
Expand description

Flushes the response stream after function execution.

This attribute macro ensures that the response stream is flushed to guarantee immediate data transmission, forcing any buffered response data to be sent to the client.

ยงUsage

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

#[flush]
async fn flush_handler(ctx: Context) {
    let _ = ctx.set_response_body("Immediate response").await;
    // Response stream is flushed after function returns
}

The macro takes no parameters and should be applied directly to async functions that accept a Context parameter.