def request_restart(self, req, msg):
        """Restart the device server.

        Returns
        -------
        success : {'ok', 'fail'}
            Whether scheduling the restart succeeded.

        Examples
        --------
        ::

            ?restart
            !restart ok

        """
        if self._restart_queue is None:
            raise FailReply("No restart queue registered -- cannot restart.")

        f = tornado_Future()

        @gen.coroutine
        def _restart():
            # .put should never block because queue should have no size limit
            self._restart_queue.put_nowait(self)
            req.reply('ok')
            raise AsyncReply

        self.ioloop.add_callback(lambda: chain_future(_restart(), f))
        return f
Restart the device server.

        Returns
        -------
        success : {'ok', 'fail'}
            Whether scheduling the restart succeeded.

        Examples
        --------
        ::

            ?restart
            !restart ok