class_docstr: A coroutine-compatible multiprocessing.Process-alike.
  All normally blocking methods are wrapped in Tornado coroutines.
class_docstr_tok: ["A","coroutine-compatible","multiprocessing.Process-alike",".","All","normally","blocking","methods","are","wrapped","in","Tornado","coroutines","."]
docstr: Set a function to be called by the event loop when the process exits.
  The function is called with the AsyncProcess as sole argument.
  
  The function may not be a coroutine function.
code: def set_exit_callback(
      self: Self, func: Callable[[Self], None]
  ) -> None:
      """
      Set a function to be called by the event loop when the process exits.
      The function is called with the AsyncProcess as sole argument.
  
      The function may not be a coroutine function.
      """
      # XXX should this be a property instead?
      assert not inspect.iscoroutinefunction(
          func
      ), "exit callback may not be a coroutine function"
      assert callable(func), "exit callback should be callable"
      assert (
          self._state.pid is None
      ), "cannot set exit callback when process already started"
      self._exit_callback = func
  
imports: from __future__ import annotations
  import asyncio
  import inspect
  import logging
  import multiprocessing
  import os
  import re
  import threading
  import weakref
  from collections.abc import Callable
  from queue import Queue
  from typing import TYPE_CHECKING
  from tornado.concurrent import Future
  from tornado.ioloop import IOLoop
  import dask
  from distributed.utils import get_mp_context, wait_for
label_desc: Use image node_id 14 for calling the AsyncProcess obj's underlying member method code with example usage: obj.set_exit_callback(func) without return types