task Flashcards
Use event emmiter to implement a simple listener-emitter code
use event payload
Use event emmiter to implement a simple listener-emitter code
use JS class
implement feature: HTTP server respond requests with data from a file:
use stream
implement feature: HTTP server respond requests with data from a file:
use Pipe
what problem it solves?
solve the problem: readable stream(the file) is much faster than the writable stream(network response) ??????
term: back pressure , too much inflow
“When the receiving end of the transfer has complex operations, or is slower for whatever reason, there is a tendency for data from the incoming source to accumulate, like a clog.
To solve this problem, there must be a delegation system in place to ensure a smooth flow of data from one source to another. Different communities have resolved this issue uniquely to their programs, Unix pipes and TCP sockets are good examples of this, and is often times referred to as flow control. In Node.js, streams have been the adopted solution.”
how to implement “cat” command in node.js?
09:21
https://www.youtube.com/watch?v=YpVDaVufDVU