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
I know that HttpServer cancels the promise returned to it if the connection is closed prematurely.
My app streams large files using Browser, so logically this is very useful for me,
but here comes the difficulty when using react/async, since there's no cancellation.
It's quite hard for me to change the flow to make it work (it would be a mixture of async/await and promises), nevertheless,
there's such a possibility. Should I take care of this? Or will streaming be terminated when the connection is closed anyway?
I tried to make artificial test, but I didn't succeed to understand.
Here's a super simplified example of how it's done for me now:
$responder = function (ServerRequestInterface$request) use ($browser): ResponseInterface {
returnawait($browser->requestStreaming('GET', '...'));
};
$server = newHttpServer(async($responder));
Activity
WyriHaximus commentedon Feb 18, 2022
This PR might interest you reactphp/async#20 as it brings cancellation to
asyncandawait(insideasync).