File tree Expand file tree Collapse file tree
packages/libs/restate-sdk/src/endpoint Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,8 +48,9 @@ export function fetcher(handler: RestateHandler) {
4848 abortSignal : event . signal ,
4949 } )
5050 . catch ( ( e ) => {
51- // Framework wrapper guarantees writeHead is called and closes the
52- // output stream; anything reaching here is a post-commit error.
51+ // wrapResponseWithSafety guarantees writeHead is called and
52+ // closes the output stream; anything reaching here is a
53+ // post-commit error.
5354 const error = ensureError ( e ) ;
5455 const logger =
5556 tryCreateContextualLogger (
Original file line number Diff line number Diff line change @@ -95,7 +95,8 @@ export function createRestateHandler(
9595}
9696
9797/**
98- * Framework-level safety net around a user-provided `RestateResponse`.
98+ * Safety net around a `RestateResponse` returned by `_handle()`, applied
99+ * in `RestateHandlerImpl.handle()` before the response reaches any adapter.
99100 *
100101 * Guarantees to adapters:
101102 * - `writeHead` is called exactly once on the success path.
Original file line number Diff line number Diff line change @@ -155,8 +155,8 @@ export class LambdaHandler {
155155 } ;
156156 }
157157
158- // Framework wrapper guarantees writeHead was called, so this resolves
159- // synchronously on the next microtask.
158+ // wrapResponseWithSafety guarantees writeHead was called, so this
159+ // resolves synchronously on the next microtask.
160160 const head = await headPromise ;
161161
162162 const responseBodyBuffer = Buffer . concat ( chunks ) ;
Original file line number Diff line number Diff line change @@ -209,7 +209,7 @@ function nodeHandlerImpl(
209209 abortSignal : abortController . signal ,
210210 } )
211211 . catch ( ( e ) => {
212- // Framework wrapper guarantees writeHead is called; anything
212+ // wrapResponseWithSafety guarantees writeHead is called; anything
213213 // reaching here is a post-commit error. Nothing to do but log.
214214 const error = ensureError ( e ) ;
215215 const logger =
You can’t perform that action at this time.
0 commit comments