kcl-readable-stream
This project convert a KCL object into a readable stream.
There are three (optional) options that can be used in the constructor:
kcl.initialize
: Will be called withdata
andcallback
when the KCL subprocess is initialized. The callback function must be called.kcl.shutdown
: Will be called withdata
andcallback
when the KCL subprocess is shut down because of an error or if the process is stopped. The callback function must be called.kcl.streamSingleRecords
: Iftrue
,data
events will be emitted with single records; otherwise, an array of records will be used. Defaults tofalse
.
Example usage
// run this with something like:// `kcl-bootstrap --java /usr/bin/java -e -p ./conf/kinesis.properties` const kcl = ;const KclReadableStream = ; const kclProcessor = kcl: { console; ; } { console; ; } streamSingleRecords: false ; // if !streamSingleRecordskclProcessor; // if streamSingleRecords === truekclProcessor; // you can also .pipe()kclProcessor; ;