/** * A specialized application of Middleware that can observe the progression and settlement of Task executions, intended * for a way of analyzing the run-time behaviour of mgFx-powered applications. */ import { FutureInstance } from 'fluture'; import { Process, Spec } from '../task'; import { MiddlewareFn } from '../middleware'; /** * The type of Event messages that the base Instrumenter will emit */ export declare type BaseEvent = { timestamp: number; }; export declare type ProcessEvent = BaseEvent & { kind: 'process'; process: Omit & { spec: Pick; }; }; export declare type ResolutionEvent = BaseEvent & { kind: 'resolution'; id: string; value: any; }; export declare type RejectionEvent = BaseEvent & { kind: 'rejection'; id: string; reason: any; }; export declare type CancellationEvent = BaseEvent & { kind: 'cancellation'; id: string; }; export declare type Event = ProcessEvent | ResolutionEvent | RejectionEvent | CancellationEvent; /** * The configuration options that should be passed to `makeInstrumenter` when making a specialized Instrumenter. * The `sink` function will receive every Event that is seen by the Instrumenter. */ export declare type Config = { receiver: (event: Event) => void; }; /** * Creates a Middleware function that: * - Emits `process` Events *before* a Process begins execution. * - Emits `rejection` or `resolutions` Events *after* a Process has completed (successfully or unsuccessfully). * - Emits `cancellation` Events whenever a Process was cancelled. */ export declare const makeInstrumenter: (config: Config) => MiddlewareFn, FutureInstance>; //# sourceMappingURL=instrumenter.d.ts.map