Skip to content

Commit dc45e35

Browse files
authored
Merge pull request #477 from grondo/rfc42-wait
rfc42: add waitable flag and wait RPC
2 parents d01c885 + 840a090 commit dc45e35

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

spec_42.rst

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ output and exit code to its own log stream.
127127

128128
(*integer*, REQUIRED) A bitfield comprised of zero or more flags:
129129

130-
..note::
130+
.. note::
131131

132-
These flags are ignored in background mode.
132+
The stdout, stderr, and channel flags are ignored in background mode.
133133

134134
stdout (1)
135135
Forward standard output to the client.
@@ -144,6 +144,9 @@ output and exit code to its own log stream.
144144
Send ``add-credit`` exec responses when buffer space is available
145145
for standard input or writable auxiliary channels.
146146

147+
waitable (16)
148+
Allow the subprocess to be waited on with a ``wait`` RPC.
149+
147150
.. object:: local_flags
148151

149152
(*integer*, OPTIONAL) A bitfield comprised of zero or more flags:
@@ -334,6 +337,36 @@ The :program:`kill` RPC sends a signal to a remote process.
334337

335338
The successful response SHALL contain no payload.
336339

340+
wait
341+
====
342+
343+
The :program:`wait` RPC waits for a subprocess to terminate and returns its
344+
exit status. This RPC SHALL return an error if the subprocess was not started
345+
with the waitable flag set.
346+
347+
.. object:: wait request
348+
349+
The request SHALL consist of a JSON object with the following keys:
350+
351+
.. object:: pid
352+
353+
(*integer*, REQUIRED) The process ID of the subprocess to wait for.
354+
355+
.. object:: label
356+
357+
(*string*, OPTIONAL) The label of the subprocess to wait for. If this key
358+
is present, the value of ``pid`` SHALL be ignored and the subprocess
359+
SHALL be identified by its label.
360+
361+
.. object:: wait response
362+
363+
A successful response SHALL consist of a JSON object with the following key:
364+
365+
.. object:: status
366+
367+
(*integer*, REQUIRED) The UNIX wait status value as returned by
368+
:func:`waitpid`.
369+
337370
Command Object
338371
==============
339372

spell.en.pws

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,3 +504,4 @@ fallthrough
504504
setpgrp
505505
killpg
506506
posix
507+
waitable

0 commit comments

Comments
 (0)