diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2015-02-09 12:53:52 +0100 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2015-02-09 13:28:52 +0100 |
commit | b36d4ff9301b39f5116474e435587418faafb21a (patch) | |
tree | 3ae2af9122d882b917cec3a38ec7b84d83bfcba3 /docs/src | |
parent | e5bdea8ed6c9eb875a8c084853b9853f2373f1cf (diff) | |
download | libuv-b36d4ff9301b39f5116474e435587418faafb21a.tar.gz libuv-b36d4ff9301b39f5116474e435587418faafb21a.zip |
unix: implement uv_stream_set_blocking()
Commit 393c1c5 ("unix: set non-block mode in uv_{pipe,tcp,udp}_open")
causes a regression in the io.js cluster module.
The io.js documentation states that `worker.send()` and `process.send()`
are synchronous but they no longer were after upgrading to libuv v1.2.1.
The reason they are synchronous is because of backpressure - or rather,
lack of backpressure: a slow consumer eventually causes a fast producer
to run out of memory because the backlog of pending messages in the
producer can grow unchecked.
Ergo, implement uv_stream_set_blocking() on UNIX platforms to let io.js
enable the old blocking behavior for pipes again.
Refs: https://github.com/iojs/io.js/issues/760
PR-URL: https://github.com/libuv/libuv/pull/187
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Diffstat (limited to 'docs/src')
-rw-r--r-- | docs/src/stream.rst | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/docs/src/stream.rst b/docs/src/stream.rst index 2c669cf0..1f6682ad 100644 --- a/docs/src/stream.rst +++ b/docs/src/stream.rst @@ -206,12 +206,14 @@ API Relying too much on this API is not recommended. It is likely to change significantly in the future. - Currently this only works on Windows and only for - :c:type:`uv_pipe_t` handles. + Currently only works on Windows for :c:type:`uv_pipe_t` handles. + On UNIX platforms, all :c:type:`uv_stream_t` handles are supported. Also libuv currently makes no ordering guarantee when the blocking mode is changed after write requests have already been submitted. Therefore it is recommended to set the blocking mode immediately after opening or creating the stream. + .. versionchanged:: 1.4.0 UNIX implementation added. + .. seealso:: The :c:type:`uv_handle_t` API functions also apply. |