diff options
author | isaacs <i@izs.me> | 2011-12-06 03:36:45 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2011-12-06 04:47:11 +0400 |
commit | cf20b6bf65bd037193d6e8b1b671c4659897861f (patch) | |
tree | 99dc0ef89117fdd90f2d8a3c33482451d0e18a3f /src/pipe_wrap.cc | |
parent | 6f86b9cb70f4b4d9b214ef3533efbf389fa43824 (diff) |
Fix #2257 pause/resume semantics for stdin
This makes it so that the stdin TTY-wrap stream gets ref'ed on
.resume() and unref'ed on .pause()
The semantics of the names "pause" and "resume" are a bit weird, but the
important thing is that this corrects an API change from 0.4 -> 0.6
which made it impossible to read from stdin multiple times, without
knowing when it might end up being closed. If no one has it open, this
lets the process die naturally.
LGTM'd by @ry
Diffstat (limited to 'src/pipe_wrap.cc')
-rw-r--r-- | src/pipe_wrap.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/pipe_wrap.cc b/src/pipe_wrap.cc index a2a4203a804..1870837bcae 100644 --- a/src/pipe_wrap.cc +++ b/src/pipe_wrap.cc @@ -85,6 +85,7 @@ void PipeWrap::Initialize(Handle<Object> target) { NODE_SET_PROTOTYPE_METHOD(t, "close", HandleWrap::Close); NODE_SET_PROTOTYPE_METHOD(t, "unref", HandleWrap::Unref); + NODE_SET_PROTOTYPE_METHOD(t, "ref", HandleWrap::Ref); NODE_SET_PROTOTYPE_METHOD(t, "readStart", StreamWrap::ReadStart); NODE_SET_PROTOTYPE_METHOD(t, "readStop", StreamWrap::ReadStop); |