Skip to main content

ClikaRT::runtime::RequestCallbacks

struct

Header: ClikaRT/runtime/serving.h

Event-driven completion hooks (consumer callbacks; they are CONTAINED at the boundary, so a throw from one never unwinds into the engine). With these set, the runtime pushes results on its pump thread and no blocking await is needed.

Delivery contract: callbacks are delivered serially per executor, in order; on_complete fires exactly once, after the last on_chunk, and no callback runs concurrently with or after it. Callbacks execute on the engine's pump; do not block in them (a blocking callback stalls the executor's step cadence for every session it drives).

Member functions

any()

bool any() const

True when either callback is set.

Declared in ClikaRT/runtime/serving.h, line 67

Data members

on_chunk

std::function<void(const ResponseChunk &)> on_chunk

Per streamed chunk (the last clean-finish chunk carries final=true; see ResponseChunk).

Declared in ClikaRT/runtime/serving.h, line 64

on_complete

std::function<void(Result<Response>)> on_complete

once, at finalize

Declared in ClikaRT/runtime/serving.h, line 65