Streams
@CrabDude đang làm issue này rồi.
Từ ngày 5/5/2015.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
- Break the below into coherent sections
- Explain unix pipes and their corollary with node.js streams (explaining the concept of node.js streams as well)
- Explain the need for streams (memory pressure, decreased latency, CPU amortization & convenience)
- Lead with
.pipeexamples- Emphasize that source streams can be piped to multiple destination streams
- Show example of piping from multiple source streams (
readable.pipe(writable, {end: false}))
- Cover the basics: .read(), .write(), .pause(), .resume & events: 'data', 'close', 'error'
- Mention briefly push vs pull-based streams and how Streams 2/3 uses pull streams
- Mention how back-pressure is handled
- Briefly explain buffers, link to a reference (docs or blog post or guide), and show
String(buffer) - Show 2 simple as possible examples of consuming (read: piping) each of the 4 stream types. You should use the most common examples e.g., req/res, through, fs read/write.
- Provide a common use case (e.g., A common type of duplex stream would be a WebSocket).
- Strongly recommend working through the stream-adventure nodeschool.io workshop and provide a screen shot of the stream-adventure exercise selection menu.
Advanced section:
- Explain object mode briefly, provide minimalist example and provide link to a more comprehensive explanation
- Provide code samples on how to create your own streams (i.e., .push, _read, _write & _transform) and additional links
- Show of JSON streaming example & explain !!LOUDLY!! how JSON.parse/stringify are the #1 cause of CPU blocking in node.js
The stream handbook is nice, but it's too verbose and needs more structure. In general the examples are good, so use them.
What success looks like: Succinctness and clarity. Less is more.
Reference Wikis: Authentication & Authorization, Setup
Open separate issues for required links to community sources if you're having trouble finding any.
Please assign to yourself before working on this.
/cc @NinjaSudo @philster @azoff @DiyahM
- Ngôn ngữ chính
- Không có dữ liệu ngôn ngữ
- Star
- 74
- Fork
- 18
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của codepath/nodejs_guides
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 20/100
codepath/nodejs_guides#21 · 1 bình luận ·
-
Improve Javascript/Node markdown syntax highlightingCó thể làm lại được @nesquena đã nhận 4185 ngày trước và không có pull request nào đang mở. Đang mởenhancement
codepath/nodejs_guides#19 · 1 bình luận · 1 người được giao ·
-
Project Generator/Workflow GuideĐang mởhelp wanted
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
codepath/nodejs_guides#18 · 3 bình luận ·
-
Design PatternsCó thể làm lại được @pixelknitter đã nhận 4069 ngày trước và không có pull request nào đang mở. Đang mởhelp wanted
codepath/nodejs_guides#16 · 1 người được giao ·
-
JavaScript: InheritanceCó thể làm lại được @pixelknitter đã nhận 4178 ngày trước và không có pull request nào đang mở. Đang mởhelp wanted
codepath/nodejs_guides#14 · 1 người được giao ·