writable stream api has destroySoon() for exiting after data queue has been drained

pull/22966/head
Zachary Scott 2011-02-18 18:30:15 -05:00 committed by Ryan Dahl
parent 5e78f57087
commit 67913a0232
1 changed files with 6 additions and 0 deletions

View File

@ -170,3 +170,9 @@ Same as above but with a `buffer`.
### stream.destroy()
Closes the underlying file descriptor. Stream will not emit any more events.
### stream.destroySoon()
After the write queue is drained, close the file descriptor. `destroySoon()`
can still destroy straight away, as long as there is no data left in the queue
for writes.