cork() and uncork()

Writable stream methods that hold writes in memory (cork) and then send them all together (uncork), cutting the number of system calls.

In more detail

They help when many tiny writes would otherwise each become a separate network packet. Uncork on the next tick, for example with process.nextTick, so nothing waits too long.

Related terms

Taught in

References