How to use the rx-jupyter.kernels.restart function in rx-jupyter

To help you get started, we’ve selected a few rx-jupyter examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nteract / nteract / packages / epics / src / websocket-kernel.ts View on Github external
);
      }

      if (kernel.type !== "websocket" || !kernel.id) {
        return of(
          actions.restartKernelFailed({
            error: new Error("Can only restart Websocket kernels via API."),
            kernelRef,
            contentRef
          })
        );
      }

      const id = kernel.id;

      return kernels.restart(serverConfig, id).pipe(
        mergeMap((response: AjaxResponse) => {
          if (response.status !== 200) {
            return of(
              actions.restartKernelFailed({
                error: new Error("Unsuccessful kernel restart."),
                kernelRef,
                contentRef
              })
            );
          } else {
            if (outputHandling === "Run All") {
              return of(
                actions.restartKernelSuccessful({
                  kernelRef,
                  contentRef
                }),