-
Notifications
You must be signed in to change notification settings - Fork 392
feat: add support for streaming functions #5725
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
📊 Benchmark resultsComparing with 13226a4 Package size: 233 MB⬇️ 0.03% decrease vs. 13226a4
Legend
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good! left a suggestion on what to assert on, but we can follow on that if we want.
const { stream } = require("@netlify/functions"); | ||
|
||
class TimerSource { | ||
#input; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL that private class fields have been supported since Node v12!
chunks.push(chunk.toString()) | ||
}) | ||
|
||
await pause(500) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's add an assertion on the arrival times of the chunks, to ensure that local dev isn't buffering the response. i've been bitten by that before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 4bc7c15.
Summary
Add support for streaming functions in Netlify Dev.
Part of https://github.com/netlify/pod-compute/issues/466.