How to use the rx-jupyter.kernels.connect 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 / host-cache / src / components / kernel.tsx View on Github external
if (
              currentProps.kernelName !== kernelName ||
              currentProps.cwd !== cwd ||
              currentProps.host.endpoint !== endpoint ||
              currentProps.host.token !== token
            ) {
              console.log(
                "Props changed while in the middle of starting a kernel, assuming that another kernel is starting up"
              );
              return {
                channels: null,
                error: true
              };
            }
            return {
              channels: kernels.connect(
                host,
                xhr.response.id
              ),
              error: false
            };
          }
        );
github nteract / nteract / packages / host-cache / src / components / kernel.tsx View on Github external
if (
              currentProps.kernelName !== kernelName ||
              currentProps.cwd !== cwd ||
              currentProps.host.endpoint !== endpoint ||
              currentProps.host.token !== token
            ) {
              console.log(
                "Props changed while in the middle of starting a kernel, assuming that another kernel is starting up"
              );
              return {
                channels: null,
                error: true
              };
            }
            return {
              channels: kernels.connect(host, xhr.response.id),
              error: false
            };
          }
        );
github nteract / nteract / packages / epics / src / websocket-kernel.ts View on Github external
mergeMap(({ response: session }) => {
              const kernel: RemoteKernelProps = Object.assign(
                {},
                session.kernel,
                {
                  type: "websocket",
                  sessionId,
                  cwd,
                  channels: kernels.connect(
                    serverConfig,
                    session.kernel.id,
                    sessionId
                  ),
                  kernelSpecName
                }
              );
              return of(
                actions.launchKernelSuccessful({
                  kernel,
                  kernelRef,
                  contentRef: action.payload.contentRef,
                  selectNextKernel: true
                })
              );
            }),
github nteract / nteract / applications / play / redux / epics.js View on Github external
mergeMap(data => {
          const session = uuid();
          const kernel = Object.assign({}, data.response, {
            channel: kernels.connect(
              config,
              data.response.id,
              session
            )
          });

          kernel.channel.next(kernelInfoRequest());

          return merge(
            of(
              actions.activateKernelFulfilled({
                serverId,
                kernelName,
                kernel
              })
            )
github nteract / nteract / packages / core / src / epics / websocket-kernel.js View on Github external
mergeMap(({ response: session }) => {
              const kernel: RemoteKernelProps = Object.assign(
                {},
                session.kernel,
                {
                  type: "websocket",
                  sessionId,
                  cwd,
                  channels: kernels.connect(
                    serverConfig,
                    session.kernel.id,
                    sessionId
                  ),
                  kernelSpecName
                }
              );
              return of(
                actions.launchKernelSuccessful({
                  kernel,
                  kernelRef,
                  contentRef: action.payload.contentRef,
                  selectNextKernel: true
                })
              );
            }),
github nteract / nteract / packages / epics / src / websocket-kernel.ts View on Github external
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,
            hostRef
          });

          kernel.channels.next(kernelInfoRequest());

          return of(
            actions.launchKernelSuccessful({
              kernel,
              kernelRef,
              contentRef: action.payload.contentRef,
              selectNextKernel: true
github nteract / nteract / packages / core / src / epics / websocket-kernel.js View on Github external
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
          });

          kernel.channels.next(kernelInfoRequest());

          return of(
            actions.launchKernelSuccessful({
              kernel,
              kernelRef,
              contentRef: action.payload.contentRef,
              selectNextKernel: true
            })