firebase-ios-sdk
firebase-ios-sdk copied to clipboard
Functions chunky response
Description
I write response by chunks. On my local server it works, but Firebase Function return response only after "res.end()"
exports.cloudFunctionEntryPoint = async (req, res) => {
setTimeout(()=>{
res.write("1\n");
}, 1000)
setTimeout(()=>{
res.write("2\n");
}, 2000)
setTimeout(()=>{
res.write("3\n");
}, 3000)
setTimeout(()=>{
res.write("4\n");
}, 4000)
setTimeout(()=>{
res.write("5\n");
res.end();
}, 5000)
}
Reproducing the issue
No response
Firebase SDK Version
10.25.0
Xcode Version
15.3
Installation Method
Swift Package Manager
Firebase Product(s)
Functions
Targeted Platforms
iOS
Relevant Log Output
No response
If using Swift Package Manager, the project's Package.resolved
Expand Package.resolved
snippet
Replace this line with the contents of your Package.resolved.
If using CocoaPods, the project's Podfile.lock
Expand Podfile.lock
snippet
Replace this line with the contents of your Podfile.lock!
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
Hi @nmalevich, could you provide a code snippet of your Firebase Functions and iOS code invoking the function so I could reproduce it on my end? Thanks.
Thank you for your reply. My general question about having possibility to implement streaming data(sending response by chunks)
@nmalevich, per checking, it looks like Cloud Functions does not support data streaming. They have a timeout limitation of up to max 10MB. You may refer to this post.
Closing this issue, but feel free to comment if you have any questions.