How to use the @nteract/messaging.kernelInfoRequest function in @nteract/messaging

To help you get started, we’ve selected a few @nteract/messaging 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 / kernel-relay / src / server.ts View on Github external
// NOTE: we should generate IDs
      // We're also setting a session ID within the enchannel-zmq setup, I wonder
      // if we should use that
      const id = kernel.connectionInfo.key;

      messages[id] = [];
      kernels[id] = kernel;

      const subscription = kernel.channels.subscribe(
        (message: JupyterMessage) => {
          messages[id].push(message);
        }
      );

      const request = kernelInfoRequest();
      messages[id].push(request);
      kernel.channels.next(request);

      // NOTE: We are going to want to both:
      //
      //   subscription.unsubscribe()
      //   AND
      //   kernel.channels.complete()
      //
      //   Within our cleanup code

      return {
        id,
        status: "launched"
      };
    },
github nteract / nteract / applications / play / redux / epics.js View on Github external
switchMap(({ payload }) => {
      const { kernel, kernelName, serverId } = payload;
      // Side effect! Get that Kernel Info!
      kernel.channel.next(kernelInfoRequest());
      return kernel.channel.pipe(
        mergeMap(message => {
          const actionsArray = [
            actions.addKernelMessage({ serverId, kernelName, message })
          ];
          switch (message.header.msg_type) {
            case "status":
              actionsArray.push(
                actions.setKernelStatus({
                  serverId,
                  kernelName,
                  status: message.content.execution_state
                })
              );
              break;
            case "kernel_info_reply":
github nteract / kernel-relay / src / server.ts View on Github external
// NOTE: we should generate IDs
      // We're also setting a session ID within the enchannel-zmq setup, I wonder
      // if we should use that
      const id = kernel.connectionInfo.key;

      messages[id] = [];
      kernels[id] = kernel;

      const subscription = kernel.channels.subscribe(
        (message: JupyterMessage) => {
          messages[id].push(message);
        }
      );

      const request = kernelInfoRequest();
      messages[id].push(request);
      kernel.channels.next(request);

      // NOTE: We are going to want to both:
      //
      //   subscription.unsubscribe()
      //   AND
      //   kernel.channels.complete()
      //
      //   Within our cleanup code

      return {
        id,
        status: "launched"
      };
    },
github nteract / create-nteract-app / src / template / components / code-state.js View on Github external
intervalId = setInterval(() => {
      if (kernelInfo) {
        clearInterval(intervalId);
        return;
      }
      this.props.kernel.channels.next(messaging.kernelInfoRequest());
    }, 300);
  }
github nteract / create-nteract-app / src / template / components / code-area.js View on Github external
intervalId = setInterval(() => {
      if (kernelInfo) {
        clearInterval(intervalId);
        return;
      }
      this.props.kernel.channels.next(messaging.kernelInfoRequest());
    }, 300);
  }
github makebrainwaves / BrainWaves / app / epics / jupyterEpics.js View on Github external
    map(() => state$.value.jupyter.mainChannel.next(kernelInfoRequest())),
    ignoreElements()
github nteract / nteract / packages / core / src / epics / websocket-kernel.js View on Github external
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
            })
          );
        })
      );
github nteract / nteract / packages / epics / src / websocket-kernel.ts View on Github external
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
            })
          );
        }),
        catchError(error => {