This is example code for blog post comparing AWS Lambda to IronWorker.
TODO: LINK TO POST
The post has information on testing out the helloworld example. This README will show you how to run the CreateThumbnail example which is part of the AWS Walkthrough #2.
AWS Walkthrough #2 uses S3’s event actions to call a Lambda function, you can accomplish the same thing using IronWorker’s webhook endpoint to start an IronWorker when an s3 event occurs.
CreateThumbnail Example
Follow the instructions here to try the Lambda version: http://docs.aws.amazon.com/lambda/latest/dg/walkthrough-s3-events-adminuser.html
To run the exact same thing on IronWorker, do the following:
- Either clone this directory or copy
CreateThumbnailIron.js
andthumbnail.worker
- Create a node_modules directory (if you don't already have it from the AWS walkthrough)
- Run
npm install async gm aws-sdk
iron_worker upload thumbnail
iron_worker queue --payload-file thumbnail-input.txt thumbnail
- Check HUD to see that it worked.
- Setup S3 Notifications to hit the
thumbnail
worker webhook endpoint: http://dev.iron.io/worker/reference/api/#queue_a_task_from_a_webhook
TODO: put AWS credentials in config file and use it like so: http://docs.aws.amazon.com/AWSRubySDK/latest/AWS.html#config-class_method