UNPKG

@emeraldpay/api

Version:
28 lines (27 loc) 964 B
/// <reference types="node" /> import * as console from 'console'; import { ManagedPublisher, Publisher } from './Publisher'; import { ContinueCheck } from './Retry'; export type RemoteCall<T, R> = (request: T) => Publisher<R>; export interface MethodExecutor { connected(): void; cancel(): void; execute(reconnect: () => void): void; terminate(): void; } export declare function isMethodExecutor(executor: unknown): executor is MethodExecutor; type Logger = typeof console | undefined; export declare class Executor<T, R> extends ManagedPublisher<R> implements MethodExecutor { private readonly call; private readonly request; private connections; private checker; private logger; private upstream; constructor(call: RemoteCall<T, R>, checker: ContinueCheck, request: T); setLogger(logger: Logger | undefined): void; cancel(): void; execute(reconnect: () => void): void; terminate(): void; } export {};