3 ms·
Are you using AWS Lambda to provide the sandboxing? If so: How does the user code actually end up running on the Lambda? Do you have a generic wrapper Lambda w
by ryanworl 7y ago
Are you using AWS Lambda to provide the sandboxing? If so:
How does the user code actually end up running on the Lambda? Do you have a generic wrapper Lambda which `eval`s the user code, or do you deploy an individual Lambda for each function, etc?
- nzoschke 7y agoYes we are using Lambda under the hood. Every customer's custom source or destination is its own Lambda function. This gives us a ton of fine-grained isolation, scalability and visibility out of the box. We ask customers to implement a single function that converts an incoming webhook to Segment data points: async function onRequest(request, settings) { Segment.track(...) } Inside the function we save the users code to `handler.js` and inject index.js that loads and calls the users `onRequest` function.