task Flashcards

1
Q

Use event emmiter to implement a simple listener-emitter code

use event payload

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Use event emmiter to implement a simple listener-emitter code

use JS class

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

implement feature: HTTP server respond requests with data from a file:

use stream

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

implement feature: HTTP server respond requests with data from a file:

use Pipe

what problem it solves?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

how to implement “cat” command in node.js?

A

09:21
https://www.youtube.com/watch?v=YpVDaVufDVU

How well did you know this?
1
Not at all
2
3
4
5
Perfectly