How to use the @jupyterlab/services.Kernel.listRunning function in @jupyterlab/services

To help you get started, we’ve selected a few @jupyterlab/services 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 DonJayamanne / pythonVSCode / src / client / datascience / jupyter / jupyterSessionManager.ts View on Github external
public async getRunningKernels(): Promise {
        const models = await Kernel.listRunning(this.serverSettings);
        // Remove duplicates.
        const dup = new Set();
        return models
            .map(m => {
                return {
                    id: m.id,
                    name: m.name,
                    lastActivityTime: m.last_activity ? new Date(Date.parse(m.last_activity.toString())) : new Date(),
                    numberOfConnections: m.connections ? parseInt(m.connections.toString(), 10) : 0
                };
            })
            .filter(item => {
                if (dup.has(item.id)) {
                    return false;
                }
                dup.add(item.id);
github jupyterlab / jupyterlab-data-explorer / tests / test-services / src / kernel / kernel.spec.ts View on Github external
it('should accept server settings', async () => {
      const serverSettings = makeSettings();
      const kernel = await Kernel.startNew({ serverSettings });
      const response = await Kernel.listRunning(serverSettings);
      expect(toArray(response).length).to.be.greaterThan(0);
      await kernel.shutdown();
    });
github jupyterlab / jupyterlab-data-explorer / tests / test-services / src / kernel / kernel.spec.ts View on Github external
it('should throw an error for an error response', async () => {
      const settings = getRequestHandler(500, {});
      const promise = Kernel.listRunning(settings);
      await expectFailure(promise, '');
    });
  });
github jupyterlab / jupyterlab / tests / test-services / src / kernel / kernel.spec.ts View on Github external
it('should yield a list of valid kernel ids', async () => {
      const response = await Kernel.listRunning();
      expect(toArray(response).length).to.be.greaterThan(0);
    });
github jupyterlab / jupyterlab / tests / test-services / src / kernel / kernel.spec.ts View on Github external
it('should yield a list of valid kernel ids', async () => {
      const response = await Kernel.listRunning();
      expect(toArray(response).length).to.be.greaterThan(0);
    });
github jupyterlab / jupyterlab / tests / test-services / src / kernel / kernel.spec.ts View on Github external
it('should accept server settings', async () => {
      const serverSettings = makeSettings();
      const kernel = await Kernel.startNew({ serverSettings });
      const response = await Kernel.listRunning(serverSettings);
      expect(toArray(response).length).to.be.greaterThan(0);
      await kernel.shutdown();
    });
github jupyterlab / jupyterlab / tests / test-services / src / kernel / kernel.spec.ts View on Github external
it('should throw an error for an error response', async () => {
      const settings = getRequestHandler(500, {});
      const promise = Kernel.listRunning(settings);
      await expectFailure(promise, '');
    });
  });
github jupyterlab / jupyterlab / tests / test-services / src / kernel / kernel.spec.ts View on Github external
it('should accept server settings', async () => {
      const serverSettings = makeSettings();
      const kernel = await Kernel.startNew({ serverSettings });
      const response = await Kernel.listRunning(serverSettings);
      expect(toArray(response).length).to.be.greaterThan(0);
      await kernel.shutdown();
    });
github jupyterlab / jupyterlab-data-explorer / tests / test-services / src / kernel / kernel.spec.ts View on Github external
it('should yield a list of valid kernel ids', async () => {
      const response = await Kernel.listRunning();
      expect(toArray(response).length).to.be.greaterThan(0);
    });
github jupyterlab / jupyterlab / tests / test-services / src / kernel / kernel.spec.ts View on Github external
it('should throw an error for an error response', async () => {
      const settings = getRequestHandler(500, {});
      const promise = Kernel.listRunning(settings);
      await expectFailure(promise, '');
    });
  });