Skip to content

server: refactor server_stream - #25541

Merged
ngxson merged 7 commits into
ggml-org:masterfrom
ngxson:xsn/server_spipe_improve
Jul 11, 2026
Merged

ngxson merged 7 commits into
ggml-org:masterfrom
ngxson:xsn/server_spipe_improve

Conversation

@ngxson

@ngxson ngxson commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Overview

Refactor server_stream (stream replay) to make the code more self-contained:

  1. no more spipe in server_http_res
  2. no more server_http_res::stop(), this was a non-thread-safe call before this PR

spipe drain and pipe logic is moved to a new server_res_spipe that extends from server_http_res. It hooks into next() to implement a tee-style pipe. server_http_res should not know anything about spipe

Requirements

@ngxson
ngxson requested a review from ServeurpersoCom July 10, 2026 21:19
@ngxson
ngxson requested a review from a team as a code owner July 10, 2026 21:19

@ServeurpersoCom ServeurpersoCom left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick test OK, nice improvement!

@ServeurpersoCom ServeurpersoCom added the merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. label Jul 10, 2026
@ServeurpersoCom

Copy link
Copy Markdown
Contributor

I was also about to forget the README-dev.md doc: 6522fd6

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Jul 11, 2026
@ngxson
ngxson merged commit ea1f7bb into ggml-org:master Jul 11, 2026
22 of 25 checks passed
satindergrewal pushed a commit to satindergrewal/llama.cpp that referenced this pull request Aug 12, 2026
* server: refactoring, remove spipe from server_http_res

* wip

* remove non-thread-safe rd.stop() call

* move server_res_spipe

* nits

* improve server_stream_create_spipe

* server-stream: update dev docs for the improved API

---------

Co-authored-by: Pascal <[email protected]>
zbrad pushed a commit to zbrad/llama.cpp that referenced this pull request Sep 10, 2026
* server: refactoring, remove spipe from server_http_res

* wip

* remove non-thread-safe rd.stop() call

* move server_res_spipe

* nits

* improve server_stream_create_spipe

* server-stream: update dev docs for the improved API

---------

Co-authored-by: Pascal <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants