summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-09-06 16:27:24 +0200
committerBram Moolenaar <Bram@vim.org>2018-09-06 16:27:24 +0200
commit0b1468884a2a1c5d3442cbb7119330e307f0aa3d (patch)
treea459e23a481dc0f19bbbe4acbdc35756ed2c7efa /runtime
parented5a9d661248a2160368f1b0ab3a1bf74831db04 (diff)
patch 8.1.0350: Vim may block on ch_sendraw()v8.1.0350
Problem: Vim may block on ch_sendraw() when the job is sending data back to Vim, which isn't read yet. (Nate Bosch) Solution: Add the "noblock" option to job_start(). (closes #2548)
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/channel.txt14
1 files changed, 14 insertions, 0 deletions
diff --git a/runtime/doc/channel.txt b/runtime/doc/channel.txt
index 4cc36258c0..fd08cd4974 100644
--- a/runtime/doc/channel.txt
+++ b/runtime/doc/channel.txt
@@ -163,6 +163,9 @@ Use |ch_status()| to see if the channel could be opened.
The "close_cb" is also considered for this.
"never" All messages will be kept.
+ *channel-noblock*
+"noblock" Same effect as |job-noblock|. Only matters for writing.
+
*waittime*
"waittime" The time to wait for the connection to be made in
milliseconds. A negative number waits forever.
@@ -594,6 +597,17 @@ See |job_setoptions()| and |ch_setoptions()|.
Note: when writing to a file or buffer and when
reading from a buffer NL mode is used by default.
+ *job-noblock*
+"noblock": 1 When writing use a non-blocking write call. This
+ avoids getting stuck if Vim should handle other
+ messages in between, e.g. when a job sends back data
+ to Vim. It implies that when `ch_sendraw()` returns
+ not all data may have been written yet.
+ This option was added in patch 8.1.0350, test with: >
+ if has("patch-8.1.350")
+ let options['noblock'] = 1
+ endif
+<
*job-callback*
"callback": handler Callback for something to read on any part of the
channel.