How to use the rx-jupyter.sessions.create 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 / core / src / epics / websocket-kernel.js View on Github external
}

      // TODO: Create a START_SESSION action instead (?)
      const sessionPayload = {
        kernel: {
          id: null,
          name: kernelSpecName
        },
        name: "",
        // TODO: Figure where the leading slash comes from in the content store
        path: content.filepath.replace(/^\/+/g, ""),
        type: "notebook"
      };

      // TODO: Handle failure cases here
      return sessions.create(serverConfig, sessionPayload).pipe(
        mergeMap(data => {
          const session = data.response;

          const sessionId = castToSessionId(session.id);

          const kernel: RemoteKernelProps = Object.assign({}, session.kernel, {
            type: "websocket",
            info: null,
            sessionId: sessionId,
            cwd,
            channels: kernels.connect(
              serverConfig,
              session.kernel.id,
              sessionId
            ),
            kernelSpecName
github nteract / nteract / applications / jupyter-extension / nteract_on_jupyter / app / triggers / open-notebook.ts View on Github external
mergeMap(({ response }) => {
        const filepath: string = response.path;

        const sessionPayload: SessionPayload = {
          kernel: {
            id: null,
            name: ks.name
          },
          name: "",
          path: filepath,
          type: "notebook"
        };

        return forkJoin(
          // Get their kernel started up
          sessions.create(serverConfig, sessionPayload),
          // Save the initial notebook document
          contents.save(serverConfig, filepath, {
            content: notebook,
            type: "notebook"
          })
        );
      }),
      first(),
github nteract / nteract / packages / epics / src / websocket-kernel.ts View on Github external
}

      // TODO: Create a START_SESSION action instead (?)
      const sessionPayload = {
        kernel: {
          id: null,
          name: kernelSpecName
        },
        name: "",
        // TODO: Figure where the leading slash comes from in the content store
        path: content.filepath.replace(/^\/+/g, ""),
        type: "notebook"
      };

      // TODO: Handle failure cases here
      return sessions.create(serverConfig, sessionPayload).pipe(
        mergeMap(data => {
          const session = data.response;

          const sessionId = castToSessionId(session.id);

          const kernel: RemoteKernelProps = Object.assign({}, session.kernel, {
            type: "websocket",
            info: null,
            sessionId,
            cwd,
            channels: kernels.connect(
              serverConfig,
              session.kernel.id,
              sessionId
            ),
            kernelSpecName,