class_docstr: Wraps ``subprocess.Popen`` with IOStream support.
  
  The constructor is the same as ``subprocess.Popen`` with the following
  additions:
  
  * ``stdin``, ``stdout``, and ``stderr`` may have the value
    ``tornado.process.Subprocess.STREAM``, which will make the corresponding
    attribute of the resulting Subprocess a `.PipeIOStream`. If this option
    is used, the caller is responsible for closing the streams when done
    with them.
  
  The ``Subprocess.STREAM`` option and the ``set_exit_callback`` and
  ``wait_for_exit`` methods do not work on Windows. There is
  therefore no reason to use this class instead of
  ``subprocess.Popen`` on that platform.
  
  .. versionchanged:: 5.0
     The ``io_loop`` argument (deprecated since version 4.1) has been removed.
class_docstr_tok: ["Wraps","``","subprocess.Popen","``","with","IOStream","support",".","The","constructor","is","the","same","as","``","subprocess.Popen","``","with","the","following","additions",":","*","``","stdin","``",",","``","stdout","``",",","and","``","stderr","``","may","have","the","value","``","tornado.process.Subprocess.STREAM","``",",","which","will","make","the","corresponding","attribute","of","the","resulting","Subprocess","a","`",".PipeIOStream","`",".","If","this","option","is","used",",","the","caller","is","responsible","for","closing","the","streams","when","done","with","them",".","The","``","Subprocess.STREAM","``","option","and","the","``","set_exit_callback","``","and","``","wait_for_exit","``","methods","do","not","work","on","Windows",".","There","is","therefore","no","reason","to","use","this","class","instead","of","``","subprocess.Popen","``","on","that","platform",".","..","versionchanged",":",":","5.0","The","``","io_loop","``","argument","(","deprecated","since","version","4.1",")","has","been","removed","."]
docstr: Runs ``callback`` when this process exits.
  
  The callback takes one argument, the return code of the process.
  
  This method uses a ``SIGCHLD`` handler, which is a global setting
  and may conflict if you have other libraries trying to handle the
  same signal.  If you are using more than one ``IOLoop`` it may
  be necessary to call `Subprocess.initialize` first to designate
  one ``IOLoop`` to run the signal handlers.
  
  In many cases a close callback on the stdout or stderr streams
  can be used as an alternative to an exit callback if the
  signal handler is causing a problem.
  
  Availability: Unix
docstr_tok: ["Runs","``","callback","``","when","this","process","exits",".","The","callback","takes","one","argument",",","the","return","code","of","the","process",".","This","method","uses","a","``","SIGCHLD","``","handler",",","which","is","a","global","setting","and","may","conflict","if","you","have","other","libraries","trying","to","handle","the","same","signal",".","If","you","are","using","more","than","one","``","IOLoop","``","it","may","be","necessary","to","call","`","Subprocess.initialize","`","first","to","designate","one","``","IOLoop","``","to","run","the","signal","handlers",".","In","many","cases","a","close","callback","on","the","stdout","or","stderr","streams","can","be","used","as","an","alternative","to","an","exit","callback","if","the","signal","handler","is","causing","a","problem",".","Availability",":","Unix"]
code: def set_exit_callback(self, callback: Callable[[int], None]) -> None:
      """Runs ``callback`` when this process exits.
  
      The callback takes one argument, the return code of the process.
  
      This method uses a ``SIGCHLD`` handler, which is a global setting
      and may conflict if you have other libraries trying to handle the
      same signal.  If you are using more than one ``IOLoop`` it may
      be necessary to call `Subprocess.initialize` first to designate
      one ``IOLoop`` to run the signal handlers.
  
      In many cases a close callback on the stdout or stderr streams
      can be used as an alternative to an exit callback if the
      signal handler is causing a problem.
  
      Availability: Unix
      """
      self._exit_callback = callback
      Subprocess.initialize()
      Subprocess._waiting[self.pid] = self
      Subprocess._try_cleanup_process(self.pid)
  
imports: import asyncio
  import os
  import multiprocessing
  import signal
  import subprocess
  import sys
  import time
  from binascii import hexlify
  from tornado.concurrent import Future, future_set_result_unless_cancelled, future_set_exception_unless_cancelled
  from tornado import ioloop
  from tornado.iostream import PipeIOStream
  from tornado.log import gen_log
  import typing
  from typing import Optional, Any, Callable
label_desc: Use image node_id 2 for calling the Subprocess obj's underlying member method code with example usage: obj.set_exit_callback(callback) without return types