swoole / swoole-src

🚀 Coroutine-based concurrency library for PHP
https://www.swoole.com
Apache License 2.0
18.44k stars 3.16k forks source link

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

Open ezimuel opened 5 years ago

ezimuel commented 5 years ago

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!

matyhtf commented 5 years ago

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

ezimuel commented 5 years ago

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

ezimuel commented 5 years ago

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

Gemorroj commented 4 years ago

@matyhtf @twose any plans for this proposal?

deminy commented 4 years ago

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

embluk commented 4 years ago

@deminy Any updates on this feature?

deminy commented 4 years ago

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.

embluk commented 4 years ago

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!

qiqizjl commented 3 years ago

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

grayTele commented 11 months ago

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