Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

through stream

.----------------------------------------.
| write(data)-------->emit('data', data`)|
`----------------------------------------`

duplex stream (across a network)

                               |
 .--client-stream---------.    |     .----server-stream-------.
 |                        |    |     |                        |
 |  write(data1) ----------------------> emit('data', data1)  |
 |                        |    |     |                        |
 |  emit('data', data2) <-------------- write(data2)          |
 |                        |    |     |                        |
 `------------------------`    |     `------------------------`
                               |

duplex stream (to an abstraction)

                               |
 .--dnode-stream----------.    | 
 |                        |    |   /* what does dnode do here ? */  
 |  write(data1) --------------->  
 |                        |    |     D N O D E
 |  emit('data', data2) <-------
 |                        |    |   /*  that is up to dnode  */
 `------------------------`    |`
                               |

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.