import type { EventHandlerFactory, Messages, PollOptions, ProjectorFactory, State } from "../types"; /** * Polls the `store` for committed events after the factory's `watermark`. This should be the entry * point to reactive service's event handlers. * * **Note**: Polls are serialized in order to avoid competing consumers from processing the same events more than once, but * consumers must be idempotent to accomodate potential failures and timeouts. * * > *Using a basic `leasing` strategy to get this working (distributed lock persisted in the store as subscriptions)* * * TODO: improve with Redis or some other efficient mechanism * * @param factory the event handler factory (policy, process manager, or projector) * @param names the event names to poll * @param timeout the lease timeout in ms * @param limit the max number of events to poll * @returns number of handled events, and error message when something fails */ export declare function poll(factory: EventHandlerFactory | ProjectorFactory, options: PollOptions): Promise<{ count: number; error?: string; }>; /** * Drains consumer subscription by polling events until the end of the stream is reached or an error occurs * @param factory event handler factory (policy, process manager, or projector) * @param options poll options * @returns number of handled events, and error message when something fails */ export declare function drain(factory: EventHandlerFactory | ProjectorFactory, options: PollOptions): Promise<{ total: number; times: number; error?: string; }>; //# sourceMappingURL=poll.d.ts.map