code: def register_dispatch_wrapper(wrapper):
      
  
      signature = inspect.getargspec(wrapper)
      if any([len(signature.args) != 1,
              signature.varargs is None,
              signature.keywords is None]):
          raise TypeError("Wrapper signature mismatch")
  
      def _wrapper(func, *args, **kwargs):
          """Exception handling"""
          try:
              return wrapper(func, *args, **kwargs)
          except Exception as e:
              # Kill subprocess
              _state["currentServer"].stop()
              traceback.print_exc()
              raise e
  
      _state["dispatchWrapper"] = _wrapper
docs: Register a dispatch wrapper for servers
  
      The wrapper must have this exact signature:
          (func, *args, **kwargs)