Entropic 2.14.3
Local-first agentic inference engine
Loading...
Searching...
No Matches
entropic::RunStreamScope Class Reference

RAII: publish a streaming run's sink to its own thread (gh#208). More...

#include <entropic/types/run_scope.h>

Public Member Functions

 RunStreamScope (RunStreamFn fn, void *user_data)
 Publish (fn, user_data) as this thread's stream sink.
 
 ~RunStreamScope ()
 Restore the previously published sink.
 
 RunStreamScope (const RunStreamScope &)=delete
 
RunStreamScope & operator= (const RunStreamScope &)=delete
 

Detailed Description

RAII: publish a streaming run's sink to its own thread (gh#208).

Generation runs inline on the run's thread — the property gh#158's per-run cancel token already relies on — so every chunk the run emits reaches this sink and no other run's. Restores the previous sink on destruction, so a nested streaming scope cannot orphan an outer one.

Returns
An RAII guard binding this thread to the sink until it goes out of scope, at which point the previous sink is restored. @req REQ-LOOP-008
Version
2.14.2

Definition at line 217 of file run_scope.h.

Constructor & Destructor Documentation

◆ RunStreamScope()

entropic::RunStreamScope::RunStreamScope ( RunStreamFn  fn,
void *  user_data 
)

Publish (fn, user_data) as this thread's stream sink.

Publish a streaming run's sink to this thread (gh#208).

Parameters
fnSink; nullptr installs "no sink".
user_dataForwarded to fn.
Returns
n/a (constructor). @req REQ-LOOP-008
Version
2.14.2
Parameters
fnSink.
user_dataForwarded to fn. @req REQ-LOOP-008
Version
2.14.2

Definition at line 150 of file run_scope.cpp.

◆ ~RunStreamScope()

entropic::RunStreamScope::~RunStreamScope ( )

Restore the previously published sink.

Restore the previous sink (gh#208).

Returns
n/a (destructor). @req REQ-LOOP-008
Version
2.14.2

@req REQ-LOOP-008

Version
2.14.2

Definition at line 161 of file run_scope.cpp.


The documentation for this class was generated from the following files: