(self)
Stop the currently running command.
Stop the currently running command.
Stop the currently running command .
def stop(self):
        """
        Stop the currently running command.
        """
        log.info("Stopping remote Pipeline")
        if self.state in [PSInvocationState.STOPPING,
                          PSInvocationState.STOPPED]:
            return
        elif self.state != PSInvocationState.RUNNING:
            raise InvalidPipelineStateError(
                self.state, PSInvocationState.RUNNING,
                "stop a running pipeline"
            )

        self.state = PSInvocationState.STOPPING
        self.runspace_pool.shell.signal(SignalCode.PS_CTRL_C,
                                        str(self.id).upper())
        self.state = PSInvocationState.STOPPED
        del self.runspace_pool.pipelines[self.id]
def stop ( self ) : log . info ( "Stopping remote Pipeline" ) if self . state in [ PSInvocationState . STOPPING , PSInvocationState . STOPPED ] : return elif self . state != PSInvocationState . RUNNING : raise InvalidPipelineStateError ( self . state , PSInvocationState . RUNNING , "stop a running pipeline" ) self . state = PSInvocationState . STOPPING self . runspace_pool . shell . signal ( SignalCode . PS_CTRL_C , str ( self . id ) . upper ( ) ) self . state = PSInvocationState . STOPPED del self . runspace_pool . pipelines [ self . id ]