Code Monkey home page Code Monkey logo

aws-promised's People

Contributors

bencassidy avatar benke avatar bryancrotaz avatar cberube avatar gjmurakami avatar jinsyaoommen avatar nackjicholson avatar nemtsov avatar simon-p-r avatar wambosa avatar yyolk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aws-promised's Issues

Memoize causes fetching the same configured instance on several EC2 creations

I was having this issue yesterday: http://stackoverflow.com/questions/32015345/data-returned-from-promises-with-aws-sdk-for-node-and-bluebird

And finally I found out what was causing it.

It may be that I don't understand properly why memoize is being used here, but, from what I understood, if I create an EC2-promised instance with a concrete configuration, like follows:

var AWS = require('aws-promised'), ec2 = AWS.ec2({region: 'us-east-1'});

If later on I need to create new EC2 instances with different regions configurations, simply because I could maybe request data per each region, by having memoize there what I get is a new instance with the previous configuration, which is wrong.

By commenting out the memoization on this file: https://github.com/davidpelayo/aws-promised/blob/master/ecs.js at the end, I get the expected results, as posted in the stackoverflow issue.

Could you elaborate why this would be happening, why memoize would be needed here and what the alternatives would be to solve my issues if there is any?

Thanks in advance.

Found docs which suggest aws-sdk supports the promise API.

http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-making-requests.html

@jinsyaoommen I'm not sure if you are already aware of this, but at the bottom of that page there's a description of how to make a request using a promise when they're supported either natively, or you provide a polyfill module such as bluebird.

I haven't actually confirmed that it works, just found those docs. I have doubts that it's supported fully for all the aws-sdk clients.

If promises are supported by aws-sdk and anyone gets it to work, it could be a reason to put up a notice of deprecation or abandon support for this module.

Make factory methods stand alone modules in the root of the repo.

I just realized how stupid it is to do:

var getS3 = require('aws-promised').getS3;

When we could just do:

var getS3 = require('aws-promised/getS3');

We should still expose them as require('aws-promised').getS3 as methods in the index.js but this would be in tune with the moves lodash and other util libraries have made in order to make them more piecemeal modular.

Contributing

Hi

I would like to contribute, what other modules do you need integrating? I am currently learning bluebird so think this will help me to learn.

Thanks
Simon

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.