/*! * Copyright (c) Microsoft Corporation and contributors. All rights reserved. * Licensed under the MIT License. */ /// import { EventEmitter } from "events"; import { IContext, IQueuedMessage, ILogger, IContextErrorData, IRoutingKey } from "@fluidframework/server-services-core"; /** * @internal */ export declare class DocumentContext extends EventEmitter implements IContext { private readonly routingKey; readonly log: ILogger | undefined; private readonly getLatestTail; private readonly getContextManagerPauseState; private headInternal; private tailInternal; private lastSuccessfulOffsetInternal; private closed; private contextError; private headPaused; constructor(routingKey: IRoutingKey, head: IQueuedMessage, log: ILogger | undefined, getLatestTail: () => IQueuedMessage, getContextManagerPauseState: () => { headPaused: boolean; tailPaused: boolean; }); get head(): IQueuedMessage; get tail(): IQueuedMessage; get lastSuccessfulOffset(): number; get documentId(): string; /** * Returns whether or not there is pending work in flight - i.e. the head and tail are not equal */ hasPendingWork(): boolean; /** * Sets the last successfully processed offset. */ setLastSuccessfulOffset(offset: number): void; /** * Sets the state to pause, i.e. headPaused = true, without emitting the pause event. * It is different than pause() method which emits the pause event. * This is used to set the state to pause when another doc in the same kafka partition triggered pause and we want to pause all the docs in that kafka partition. */ setStateToPause(): void; /** * Updates the head offset for the context. */ setHead(head: IQueuedMessage): boolean; checkpoint(message: IQueuedMessage, restartOnCheckpointFailure?: boolean): void; error(error: any, errorData: IContextErrorData): void; close(): void; getContextError(): undefined; pause(offset?: number, reason?: any): void; resume(): void; } //# sourceMappingURL=documentContext.d.ts.map