diff options
author | Anna Henningsen <anna@addaleax.net> | 2018-02-22 14:37:58 +0100 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2018-03-15 12:53:06 +0100 |
commit | f734b3eb04c0d355ef7ab893ed5869b867d35642 (patch) | |
tree | 88950ea4877e1394e491bcfc4b9f8d217f27a0b6 /src/stream_base-inl.h | |
parent | c412150582de524beacd180646ec5f18c518a922 (diff) | |
download | android-node-v8-f734b3eb04c0d355ef7ab893ed5869b867d35642.tar.gz android-node-v8-f734b3eb04c0d355ef7ab893ed5869b867d35642.tar.bz2 android-node-v8-f734b3eb04c0d355ef7ab893ed5869b867d35642.zip |
src: give StreamBases the capability to ask for data
Add a `OnStreamWantsWrite()` event that allows streams to
ask for more input data if they want some.
PR-URL: https://github.com/nodejs/node/pull/18936
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'src/stream_base-inl.h')
-rw-r--r-- | src/stream_base-inl.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/stream_base-inl.h b/src/stream_base-inl.h index b7495a80ac..f0d522a7b0 100644 --- a/src/stream_base-inl.h +++ b/src/stream_base-inl.h @@ -136,6 +136,13 @@ inline void StreamResource::EmitAfterShutdown(ShutdownWrap* w, int status) { listener_->OnStreamAfterShutdown(w, status); } +inline void StreamResource::EmitWantsWrite(size_t suggested_size) { +#ifdef DEBUG + v8::SealHandleScope handle_scope(v8::Isolate::GetCurrent()); +#endif + listener_->OnStreamWantsWrite(suggested_size); +} + inline StreamBase::StreamBase(Environment* env) : env_(env) { PushStreamListener(&default_listener_); } |