import { BackgroundEntry } from '../background-entry'; import { InternalBackgroundEntry } from '../internal-background-entry'; import { Subject } from 'rxjs'; /** * Classes implementing this interface handle all submission of work to the background processing system. * * Note that these do NOT validate the input, they just passes it along. This is * because it creates a circular reference to the processors if we try since they * define the type and validation. */ export interface BackgroundManagerLike { get backgroundManagerName(): string; immediateProcessQueue?(): Subject>; createEntry(type: string, data?: T): BackgroundEntry; wrapEntryForInternal(entry: BackgroundEntry, overrideTraceId?: string, overrideTraceDepth?: number): Promise>; addEntryToQueueByParts(type: string, data?: T, fireStartMessage?: boolean): Promise; addEntryToQueue(entry: BackgroundEntry, fireStartMessage?: boolean): Promise; addEntriesToQueue(entries: BackgroundEntry[], fireStartMessage?: boolean): Promise; fireImmediateProcessRequestByParts(type: string, data?: T): Promise; fireImmediateProcessRequest(entry: BackgroundEntry): Promise; fireStartProcessingRequest(): Promise; fetchApproximateNumberOfQueueEntries(): Promise; takeEntryFromBackgroundQueue(): Promise[]>; modifyPayloadPreProcess?(entry: InternalBackgroundEntry): Promise>; }