import { Delegator } from './Delegator'; import { Method, Claims, Manifest } from './Executor'; import { Listener } from './Listener'; import { Queuer } from './Queuer'; import { Server } from './Server'; import * as schema from '@stencila/schema'; /** * An `Executor` class implementation which combines * a `Delegator` and a `Queuer`. */ export declare class Manager extends Listener { delegator: Delegator; queuer: Queuer; constructor(servers?: Server[], delegator?: Delegator, queuer?: Queuer, timeout?: number, timelimit?: number); /** * @override Override of {@link Listener.manifest} to * provide additional properties for inspection. */ manifest(): Promise; /** * @override Override of {@link Executor.compile} that compiles a * node by walking it and delegating the compilation of child * nodes to peers. */ compile(node: Type): Promise; /** * @override Override of {@link Executor.execute} that executes a * node by walking it and delegating the execution of child * nodes to peers. * * Note that walk is async and that nodes do not wait for * previous nodes before executing. */ execute(node: Type, session?: schema.SoftwareSession, claims?: Claims, job?: string): Promise; /** * @override Override of {@link Executor.cancel} that passes on * the request to the delegator. */ cancel(job: string): Promise; /** * @override Overrides {@link Executor.begin} to begin a `SoftwareSession` * in the current environment. * * TODO: This method should only be called if * unable to delegate to a peer for a specific type of session */ begin(node: Type, claims?: Claims): Promise; /** * @override Overrides {@link Executor.end} to end a `SoftwareSession` * that was started here. * * TODO: Check that the session was begun here, otherwise delegate. */ end(node: Type, claims?: Claims): Promise; /** * Do a depth first walk of a node applying a transformation function. * * This function has three characteristics to be aware of * - recursively traverses **all** nodes, including the nodes * resulting from transformation * - awaits for the result of transformation of each child, in order * - depth first * * These characteristics make it suitable for doing an "in order" traversal * of a node e.g. executing the nodes in a document in the order that they appear. * But in some cases it may be better to use a different function e.g. in * cases where you wish to traverse all nodes but the order does not matter. */ protected walk(root: NodeType, transformer: (node: schema.Node) => Promise): Promise; /** * @override Override of {@link Executor.call} that * delegates the call. * * @description This is a fallback for methods that * are not implemented above. */ call(method: Method, params: { [key: string]: any; }): Promise; /** * @override Override of {@link Listener.start} which * also starts delegator and queuer and * periodic checking of the queue. */ start(servers?: Server[]): Promise; /** * @override Override of {@link Listener.stop} which * stops delegator (including any child processes it may have started) * and queuer. */ stop(): Promise; }