46 const char *data,
size_t data_len,
const char *
id);
int(* KlWriteFn)(void *ctx, const char *data, size_t len)
Pluggable write callback — same signature as sh_json's ShJsonWriteFn.
Definition response.h:12
int kl_sse_begin(KlResponse *res, KlSse *sse)
Begin an SSE stream.
int kl_sse_end(KlSse *sse)
End the SSE stream.
int kl_sse_event(KlSse *sse, const char *event, const char *data, size_t data_len, const char *id)
Send an SSE event.
int kl_sse_comment(KlSse *sse, const char *text, size_t len)
Send an SSE comment (keep-alive ping pattern).
SSE (Server-Sent Events) stream handle.
Definition sse.h:13
KlWriteFn write_fn
Definition sse.h:14
KlResponse * res
Definition sse.h:16
void * write_ctx
Definition sse.h:15