Mercurial > vim
diff runtime/doc/channel.txt @ 14675:71c17b688bc6 v8.1.0350
patch 8.1.0350: Vim may block on ch_sendraw()
commit https://github.com/vim/vim/commit/0b1468884a2a1c5d3442cbb7119330e307f0aa3d
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Sep 6 16:27:24 2018 +0200
patch 8.1.0350: Vim may block on ch_sendraw()
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)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 06 Sep 2018 16:30:06 +0200 |
parents | 2f7e67dd088c |
children | bd7461db24b3 |
line wrap: on
line diff
--- a/runtime/doc/channel.txt +++ b/runtime/doc/channel.txt @@ -163,6 +163,9 @@ Use |ch_status()| to see if the channel 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_setoption 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.