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::*;

#[response_middleware(2)]
struct ResponseMiddleware2;

impl ServerHook for ResponseMiddleware2 {
    async fn new(_ctx: &Context) -> Self {
        Self
    }

    #[epilogue_macros(send, flush)]
    async fn handle(self, ctx: &Context) {}
}

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