You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can not read anything... The problem is when call write, the cursor of stream is also moved, so read can not read anything..
Currently, must be completely written, then rewind before starting to read, it's not stream.
How do I achieve true streaming while writing and reading at the same time? Imagine download a file from http request, http server is writing, and client is reading, all in streaming.
The text was updated successfully, but these errors were encountered:
As far as I know the (PHP) stream implementation is not designed for concurrent read/write operations because they share a single cursor. You may try a different approach with a producer-consumer pattern.
Could it implement real streaming like one side is writing, and another side is reading?
Example code (async by amphp):
Synchronize code:
Can not read anything... The problem is when call write, the cursor of stream is also moved, so read can not read anything..
Currently, must be completely written, then rewind before starting to read, it's not
stream
.How do I achieve true streaming while writing and reading at the same time? Imagine download a file from http request, http server is writing, and client is reading, all in streaming.
The text was updated successfully, but these errors were encountered: