(self, lifecycle)
Set the application lifecycle that is controlling this loop.
Set the application lifecycle that is controlling this loop.
Set the application lifecycle that is controlling this loop .
def _set_lifecycle(self, lifecycle):
        """Set the application lifecycle that is controlling this loop.
        """
        if self._lifecycle is not None:
            raise ValueError("Lifecycle is already set")
        if self.is_running():
            raise RuntimeError("You can't set a lifecycle on a loop that's already running.")
        self._lifecycle = lifecycle
        self._policy._lifecycle = lifecycle
def _set_lifecycle ( self , lifecycle ) : if self . _lifecycle is not None : raise ValueError ( "Lifecycle is already set" ) if self . is_running ( ) : raise RuntimeError ( "You can't set a lifecycle on a loop that's already running." ) self . _lifecycle = lifecycle self . _policy . _lifecycle = lifecycle