diff --git a/src/stream_base.cc b/src/stream_base.cc index b1aea79d52f762..ecb5f3dd1b954e 100644 --- a/src/stream_base.cc +++ b/src/stream_base.cc @@ -195,8 +195,7 @@ int StreamBase::Writev(const FunctionCallbackInfo& args) { } err = DoWrite(req_wrap, buf_list, count, nullptr); - if (HasWriteQueue()) - req_wrap_obj->Set(env->async(), True(env->isolate())); + req_wrap_obj->Set(env->async(), True(env->isolate())); if (err) req_wrap->Dispose(); @@ -254,8 +253,7 @@ int StreamBase::WriteBuffer(const FunctionCallbackInfo& args) { } err = DoWrite(req_wrap, bufs, count, nullptr); - if (HasWriteQueue()) - req_wrap_obj->Set(env->async(), True(env->isolate())); + req_wrap_obj->Set(env->async(), True(env->isolate())); req_wrap_obj->Set(env->buffer_string(), args[1]); if (err) @@ -381,8 +379,7 @@ int StreamBase::WriteString(const FunctionCallbackInfo& args) { reinterpret_cast(send_handle)); } - if (HasWriteQueue()) - req_wrap_obj->Set(env->async(), True(env->isolate())); + req_wrap_obj->Set(env->async(), True(env->isolate())); if (err) req_wrap->Dispose(); @@ -476,10 +473,6 @@ int StreamResource::DoTryWrite(uv_buf_t** bufs, size_t* count) { return 0; } -bool StreamResource::HasWriteQueue() { - return true; -} - const char* StreamResource::Error() const { return nullptr; diff --git a/src/stream_base.h b/src/stream_base.h index 071627f3bf2a67..d063176b04a4db 100644 --- a/src/stream_base.h +++ b/src/stream_base.h @@ -162,7 +162,6 @@ class StreamResource { uv_buf_t* bufs, size_t count, uv_stream_t* send_handle) = 0; - virtual bool HasWriteQueue(); virtual const char* Error() const; virtual void ClearError(); diff --git a/src/stream_wrap.cc b/src/stream_wrap.cc index 094991107ba7aa..b639d945004cfa 100644 --- a/src/stream_wrap.cc +++ b/src/stream_wrap.cc @@ -380,10 +380,6 @@ int LibuvStreamWrap::DoWrite(WriteWrap* w, } -bool LibuvStreamWrap::HasWriteQueue() { - return stream()->write_queue_size > 0; -} - void LibuvStreamWrap::AfterUvWrite(uv_write_t* req, int status) { WriteWrap* req_wrap = WriteWrap::from_req(req); diff --git a/src/stream_wrap.h b/src/stream_wrap.h index a695f9a08a7729..0146d41c6e8c7b 100644 --- a/src/stream_wrap.h +++ b/src/stream_wrap.h @@ -55,7 +55,6 @@ class LibuvStreamWrap : public HandleWrap, public StreamBase { uv_buf_t* bufs, size_t count, uv_stream_t* send_handle) override; - bool HasWriteQueue() override; inline uv_stream_t* stream() const { return stream_;