def run(self, request_cb, notification_cb, setup_cb=None):
self._request_cb = request_cb<EOL>self._notification_cb = notification_cb<EOL>self._is_running = True<EOL>self._setup_exception = None<EOL>self._loop_thread = threading.current_thread()<EOL>def on_setup():<EOL><INDENT>try:<EOL><INDENT>setup_cb()<EOL><DEDENT>except Exception as e:<EOL><INDENT>self._setup_exception = e<EOL>self.stop()<EOL><DEDENT><DEDENT>if setup_cb:<EOL><INDENT>gr = greenlet.greenlet(on_setup)<EOL>gr.switch()<EOL><DEDENT>if self._setup_exception:<EOL><INDENT>error('<STR_LIT>'.format(self._setup_exception))<EOL>raise self._setup_exception<EOL><DEDENT>while self._pending_messages:<EOL><INDENT>msg = self._pending_messages.popleft()<EOL>getattr(self, '<STR_LIT>'.format(msg[<NUM_LIT:0>]))(*msg[<NUM_LIT:1>:])<EOL><DEDENT>self._async_session.run(self._on_request, self._on_notification)<EOL>self._is_running = False<EOL>self._request_cb = None<EOL>self._notification_cb = None<EOL>self._loop_thread = None<EOL>if self._setup_exception:<EOL><INDENT>raise self._setup_exception<EOL><DEDENT>
Run the event loop to receive requests and notifications from Nvim.

        Like `AsyncSession.run()`, but `request_cb` and `notification_cb` are
        inside greenlets.