---
title: "ClikaRT::runtime::RequestCallbacks"
sidebar_label: "RequestCallbacks"
description: "Event-driven completion hooks (consumer callbacks; they are CONTAINED at the boundary, so a throw from one never unwinds into the engine)."
---

<!-- Generated by tools/doxygen2mdx from Doxygen XML. Do not edit. -->

<span class="api-kind api-kind--struct">struct</span>

**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`](./RequestCallbacks.md#on_complete) fires exactly once, after the last [`on_chunk`](./RequestCallbacks.md#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() {#any}

<div class="api-signature">

`bool` **`any`**() `const`

</div>

True when either callback is set.

<div class="api-declared">

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

</div>

## Data members

### on\_chunk {#on_chunk}

<div class="api-signature">

`std::function<void(const` [`ResponseChunk`](./ResponseChunk.md) `&)>` **`on_chunk`**

</div>

Per streamed chunk (the last clean-finish chunk carries `final=true`; see [`ResponseChunk`](./ResponseChunk.md)).

<div class="api-declared">

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

</div>

### on\_complete {#on_complete}

<div class="api-signature">

`std::function<void(`[`Result`](../Result.md)`<`[`Response`](./Response.md)`>)>` **`on_complete`**

</div>

once, at finalize

<div class="api-declared">

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

</div>
