(self, lifecycle=None)
A non-blocking version of :meth:`run_forever`.

        This may seem like nonsense; however, an iOS app is not expected to
        invoke a blocking "main event loop" method. As a result, we need to
        be able to *start* Python event loop handling, but then return control
        to the main app to start the actual event loop.

        The implementation is effectively all the parts of a call to
        :meth:`run_forever()`, but without any of the shutdown/cleanup logic.
A non-blocking version of :meth:`run_forever`.
A non - blocking version of : meth : run_forever .
def run_forever_cooperatively(self, lifecycle=None):
        """A non-blocking version of :meth:`run_forever`.

        This may seem like nonsense; however, an iOS app is not expected to
        invoke a blocking "main event loop" method. As a result, we need to
        be able to *start* Python event loop handling, but then return control
        to the main app to start the actual event loop.

        The implementation is effectively all the parts of a call to
        :meth:`run_forever()`, but without any of the shutdown/cleanup logic.
        """
        if not self._lifecycle:
            self._set_lifecycle(lifecycle if lifecycle else CFLifecycle(self._cfrunloop))

        if self.is_running():
            raise RuntimeError(
                "Recursively calling run_forever is forbidden. "
                "To recursively run the event loop, call run().")

        self._running = True
        if hasattr(events, "_set_running_loop"):
            events._set_running_loop(self)

        self._lifecycle.start()
def run_forever_cooperatively ( self , lifecycle = None ) : if not self . _lifecycle : self . _set_lifecycle ( lifecycle if lifecycle else CFLifecycle ( self . _cfrunloop ) ) if self . is_running ( ) : raise RuntimeError ( "Recursively calling run_forever is forbidden. " "To recursively run the event loop, call run()." ) self . _running = True if hasattr ( events , "_set_running_loop" ) : events . _set_running_loop ( self ) self . _lifecycle . start ( )