This commit is contained in:
Jerry Kurian
2019-09-26 09:23:09 -04:00
parent 70edee51c4
commit a11aa10d16
12 changed files with 36 additions and 56 deletions

View File

@@ -1,7 +1,13 @@
import { Transform, TransformOptions } from "stream";
import { AccumulatorByIteratee, FlushStrategy } from "./baseDefinitions";
import { batch } from ".";
export enum FlushStrategy {
rolling = "rolling",
sliding = "sliding",
}
export type AccumulatorByIteratee<T> = (event: T, bufferChunk: T) => boolean;
function _accumulator<T>(
accumulateBy: (data: T, buffer: T[], stream: Transform) => void,
shouldFlush: boolean = true,