UNPKG

hazelcast-client

Version:

Hazelcast - open source In-Memory Data Grid - client for NodeJS

31 lines (30 loc) 873 B
/// <reference types="long" /> /// <reference types="bluebird" /> import * as Long from 'long'; import * as Promise from 'bluebird'; export declare class Batch { private nextIdLong; private increment; private batchSize; private invalidSince; private firstInvalidId; constructor(validityMillis: number, base: Long, increment: Long, batchSize: number); /** * @returns next id from the batch, * undefined if ids are exhausted or not valid anymore */ nextId(): Long; } export declare class AutoBatcher { private readonly NEW_BATCH_AVAILABLE; private queue; private batch; private requestInFlight; private supplier; private emitter; constructor(supplier: () => Promise<any>); processIdRequests(): void; private assignNewBatch(); private rejectAll(e); nextId(): Promise<Long>; }