core
core copied to clipboard
JSON Flush
Hey,
is it possible to use the Flight::json() function with flushing?
So I can call Flight::json() then the user gets a response but the script still runs after sending the data.
I tried normal flushing of content without Flight::json but that does not seem to work when using this framework 😬
The json method will always send a response, but the script will still keep running until it calls stop. So you can just add a filter Flight::before('stop', ...)
to run some code before the script exits.
Yes, but what if I have a long task to do (Like video editing) then I don’t want the user to wait the whole time until his video is done editing.
Thanks
Am 16.07.2018 um 08:46 schrieb Mike Cao [email protected]:
The json method will always send a response, but the script will still keep running until it calls stop. So you can just add a filter Flight::before('stop', ...) to run some code before the script exits.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mikecao/flight/issues/374#issuecomment-405160719, or mute the thread https://github.com/notifications/unsubscribe-auth/AS78wtqxhs5SIfytYQRGJ5K2ChNbAj_7ks5uHDbCgaJpZM4VGy_3.
See: https://github.com/mikecao/flight/issues/413
It seems that you CAN accomplish non-buffering in a route
Seems addressed