aws-lambda-stream
Advanced tools
Comparing version
@@ -13,3 +13,3 @@ "use strict"; | ||
const cdc = rule => s => s // eslint-disable-line import/prefer-default-export | ||
.filter(_filters.outLatched).filter(onEventType(rule)).tap(_utils.printStartPipeline).filter(onContent(rule)).map(toEvent(rule)).parallel(rule.parallel || Number(process.env.PARALLEL) || 4).through(rule.publish(rule)).tap(_utils.printEndPipeline); | ||
.filter(_filters.outLatched).filter(onEventType(rule)).tap(_utils.printStartPipeline).filter(onContent(rule)).map(toQueryRequest(rule)).through((0, _utils.query)(rule)).map(toEvent(rule)).parallel(rule.parallel || Number(process.env.PARALLEL) || 4).through(rule.publish(rule)).tap(_utils.printEndPipeline); | ||
@@ -22,2 +22,15 @@ exports.cdc = cdc; | ||
const toQueryRequest = rule => uow => ({ ...uow, | ||
queryRequest: !rule.queryRelated ? undefined : { | ||
KeyConditionExpression: '#pk = :pk', | ||
ExpressionAttributeNames: { | ||
'#pk': rule.pkFn || 'pk' | ||
}, | ||
ExpressionAttributeValues: { | ||
':pk': uow.event.partitionKey | ||
}, | ||
ConsistentRead: true | ||
} | ||
}); | ||
const toEvent = rule => (0, _utils.faultyAsync)(uow => !rule.toEvent ? Promise.resolve(uow) : Promise.resolve(rule.toEvent(uow, rule)).then(event => ({ ...uow, | ||
@@ -24,0 +37,0 @@ event: { ...uow.event, |
@@ -41,2 +41,38 @@ "use strict"; | ||
}); | ||
}); | ||
var _s = require("./s3"); | ||
Object.keys(_s).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function () { | ||
return _s[key]; | ||
} | ||
}); | ||
}); | ||
var _sns = require("./sns"); | ||
Object.keys(_sns).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function () { | ||
return _sns[key]; | ||
} | ||
}); | ||
}); | ||
var _sqs = require("./sqs"); | ||
Object.keys(_sqs).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function () { | ||
return _sqs[key]; | ||
} | ||
}); | ||
}); |
@@ -28,3 +28,3 @@ "use strict"; | ||
eventField = 'event', | ||
batchSize = Number(process.env.PUBLISH_BATCH_SIZE) || Number(process.env.BATCH_SIZE) || 25, | ||
batchSize = Number(process.env.PUBLISH_BATCH_SIZE) || Number(process.env.BATCH_SIZE) || 10, | ||
parallel = Number(process.env.PUBLISH_PARALLEL) || Number(process.env.PARALLEL) || 8, | ||
@@ -31,0 +31,0 @@ handleErrors = true |
{ | ||
"name": "aws-lambda-stream", | ||
"version": "0.6.0", | ||
"version": "0.7.0", | ||
"description": "Create stream processors with AWS Lambda functions.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -5,3 +5,3 @@ # aws-lambda-stream | ||
The event signature for many Lambda functions is an array containing a micro-batch of `event.Records`. Functional Reactive Programming (FRP) is the cleanest approach for processing these streams. This library provides a light-weight framework for creating these stream processors. The underlying streaming library is [Highland.js](https://highlandjs.org), replete with features like filter, map, reduce, backpressure, batching, parallel processing and more. | ||
The event signature for many Lambda functions is an array containing a micro-batch of `event.Records`. Functional Reactive Programming (FRP) is the cleanest approach for processing these streams. This library provides a light-weight framework for creating these stream processors. The underlying streaming library is [Highland.js](http://highlandjs.org), replete with features like filter, map, reduce, backpressure, batching, parallel processing and more. | ||
@@ -79,2 +79,3 @@ Support is provided for AWS EventBridge, Kinesis, DynamoDB Streams and more. | ||
tags: { [key: string]: string | number }; | ||
<entity>: any; | ||
raw?: any; | ||
@@ -81,0 +82,0 @@ eem?: any; |
105077
1.11%2219
1.98%490
0.2%