How to use the @nteract/messaging.executeRequest 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 / create-nteract-app / src / template / components / presentation-cell.js View on Github external
this.submit = () => {
      console.log("Submitting", this.state.source);
      if (this.props.kernel && this.props.kernel.channels) {
        this.props.kernel.channels.next(
          messaging.executeRequest(this.state.source)
        );
        console.log("submitted!");
      } else {
        console.warn("Could not submit, kernel not connected");
        debugger;
      }
    };
github nteract / nteract / packages / enchannel-zmq-backend / scripts / exercise-enchannel.js View on Github external
async function main() {
  var identity = uuid();
  const kernel = await launch("python3");

  const channel = await createMainChannel(kernel.config);
  const message = executeRequest('print("woo")');

  const subscription = channel.subscribe(console.log);

  channel.next(message);

  console.log("sleep 1");

  await new Promise(resolve => setTimeout(resolve, 1000));

  channel.next(message);

  console.log("sleep 2");
  await new Promise(resolve => setTimeout(resolve, 1000));

  kernel.spawn.kill("SIGKILL");
  subscription.unsubscribe();
github nteract / nteract / applications / play / redux / epics.js View on Github external
mergeMap(({ payload: { serverId, kernelName, source } }) => {
      const channelPath = [
        "entities",
        "serversById",
        serverId,
        "server",
        "activeKernelsByName",
        kernelName,
        "kernel",
        "channel"
      ];
      const channel = objectPath.get(state$.value, channelPath);
      if (channel) {
        channel.next(executeRequest(source));
      }
      return of(
        actions.clearKernelOutputs({ serverId, kernelName }),
        actions.setSource(source)
      );
    })
  );
github makebrainwaves / BrainWaves / app / epics / jupyterEpics.js View on Github external
    tap(mainChannel => mainChannel.next(executeRequest(imports()))),
    tap(mainChannel => mainChannel.next(executeRequest(utils()))),
github makebrainwaves / BrainWaves / app / epics / jupyterEpics.js View on Github external
map(channelIndex =>
      state$.value.jupyter.mainChannel.next(
        executeRequest(plotERP(channelIndex))
      )
    ),
github nteract / create-nteract-app / src / template / components / code-area.js View on Github external
onClick={() => {
              this.props.kernel.channels.next(
                messaging.executeRequest(this.state.source)
              );
            }}
          >
github makebrainwaves / BrainWaves / app / epics / jupyterEpics.js View on Github external
map(filePathsArray =>
      state$.value.jupyter.mainChannel.next(
        executeRequest(loadCSV(filePathsArray))
      )
    ),
github makebrainwaves / BrainWaves / app / components / unused / InteractivePlotWidget.js View on Github external
executeCell(cell) {
    this.props.mainChannel.subscribe(this.handleExecuteReturn);
    this.props.mainChannel.next(executeRequest(cell));
  }
github makebrainwaves / BrainWaves / app / epics / jupyterEpics.js View on Github external
map(variableName =>
      state$.value.jupyter.mainChannel.next(
        executeRequest(requestEpochsInfo(variableName))
      )
    ),