swoole-src icon indicating copy to clipboard operation
swoole-src copied to clipboard

Support of stream in HTTP request instead of swoole_http_request->rawContent(): string

Open ezimuel opened this issue 5 years ago • 10 comments

This is actually not an issue but a request for a new feature/improvement.

Right now, we have only swoole_http_request->rawContent(): string function to get the body of a HTTP request. This can be a limit for big data transfer. The proposal is to use stream to manage the HTTP request and response body. Something similar to the PSR-7 Stream here: https://www.php-fig.org/psr/psr-7/#13-streams.

Do you think that this feature can be added to Swoole? Thanks!

ezimuel avatar Feb 20 '19 14:02 ezimuel

Your proposal is very good, we have a lot of places to return large strings, we can use stream to avoid copying

matyhtf avatar Feb 21 '19 03:02 matyhtf

@matyhtf very cool! Let me know if I can help in any way. Thanks!

ezimuel avatar Feb 21 '19 14:02 ezimuel

@matyhtf any news on the proposal of using stream? Thanks!

ezimuel avatar Aug 27 '19 13:08 ezimuel

@matyhtf @twose any plans for this proposal?

Gemorroj avatar Jan 02 '20 11:01 Gemorroj

The Swoole team is focusing on code development for the next main release (4.5), which is planned to be released during Chinese New Year (around the end of this month). I won't expect @matyhtf or @twose could have time having this feature added at that time, but I will check with them and see if they could have this included in next few months. Thanks

deminy avatar Jan 02 '20 18:01 deminy

@deminy Any updates on this feature?

embluk avatar Apr 23 '20 11:04 embluk

This has been brought to the core development team three times this year, but there is no clear timeline for it yet. In short, it takes tremendous effort to support it in the coroutine server (\Swoole\Coroutine\Server), and there are a few other projects/tasks on the roadmap to finish first. I'd say no earlier than Swoole 5 or Swoole 6.

I'm sorry that it won't be there soon. Please understand that the team has been working hard to make Swoole better and to support the community; unfortunately, there isn't enough time and resources to do everything.

deminy avatar Apr 28 '20 06:04 deminy

This has been brought to the core development team three times this year, but there is no clear timeline for it yet. In short, it takes tremendous effort to support it in the coroutine server (\Swoole\Coroutine\Server), and there are a few other projects/tasks on the roadmap to finish first. I'd say no earlier than Swoole 5 or Swoole 6.

I'm sorry that it won't be there soon. Please understand that the team has been working hard to make Swoole better and to support the community; unfortunately, there isn't enough time and resources to do everything.

Okay, I understand, thank you for the update!

embluk avatar Apr 28 '20 17:04 embluk

Is there any progress on this matter? It is very inconvenient to deal with large files at present.

qiqizjl avatar Feb 04 '21 07:02 qiqizjl

调用openai接口的stream流式响应输出没有办法逐字即时输出 The stream-style response output from calling the OpenAI interface cannot be outputted instantly on a word-by-word basis.

grayTele avatar Nov 28 '23 10:11 grayTele