UNPKG

@tableau/taco-toolkit

Version:
36 lines (35 loc) 2.1 kB
/// <reference types="node" /> import { ChildProcess } from 'child_process'; import { TempDataManager } from '../../modules/temp-data-manager'; import { EPSProcessManager } from './process-manager'; /** Cache of resources and settings used for connections keyed by connection id. */ export declare class ConnectionManager { private processManager; private tempDataManager; /** Resources by connectionId */ private resourceMap; constructor(processManager: EPSProcessManager, tempDataManager: TempDataManager); private getOrAddResources; setBrowserProcess(connectionId: string, procOrCloseFunc: ChildProcess | (() => void)): void; addExtractorProcess(connectionId: string, proc: ChildProcess, extractorId: string): void; hasActiveConnection(connectionId: string): boolean; hasConnection(connectionId: string): boolean; /** Frees all resources allocated for this connection. */ free(connectionId: string): void; /** Frees browser resources (process) allocated for this connection. */ freeBrowser(connectionId: string): void; /** * @param extractorIds Kills and deregister the specified extractor processes. If omitted, it will remove all extractors. * @returns Array of the extractor IDs that are terminated. */ freeExtractors(connectionId: string, extractorIds?: string[]): string[]; /** Gets if the connection has been submitted, that is, the interactive phase has completed with submit. */ isSubmitted(connectionId: string): boolean; /** Sets if the connection has been submitted, that is, the interactive phase has completed with submit. */ setIsSubmitted(connectorId: string, isSubmitted: boolean): void; /** Gets the distinct, unique connector name used by this connection id. */ distinctConnectorName(connectionId: string): string | undefined; tacoPath(connectionId: string): string | undefined; /** Sets the distinct, unique connector name used by this connection id. */ setDistinctConnectorNameAndPath(connectionId: string, distinctConnectorName: string, tacoPath: string): void; }