Skip to content

Commit

Permalink
Call out in documentation that requests may only be sent once. (#1536)
Browse files Browse the repository at this point in the history
* Call out in documentation that requests may only be sent once. Also indicate which methods cause the request to be sent.

* Remove --production flag from browser rake task and ensure Travis is testing node 8.0
  • Loading branch information
jeskew committed May 30, 2017
1 parent 360f743 commit 43ee1fc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ node_js:
- "0.12"
- "4.2"
- "4.4"
- "5.11"
- "6.1"
- "node"
- "5"
- "6"
- "7"
- "8"

before_install:
- "if [[ `node -v` == v0.8.* ]]; then npm install -g npm || exit 0; fi"
Expand Down
2 changes: 1 addition & 1 deletion dist-tools/browser-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

var path = require('path');

var AWS = require('../');
var AWS = require('../index');

var license = [
'// AWS SDK for JavaScript v' + AWS.VERSION,
Expand Down
10 changes: 7 additions & 3 deletions lib/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ fsm.setupStates();
* request.send();
* ```
*
* Since registered callbacks may or may not be idempotent, requests should only
* be sent once. To perform the same operation multiple times, you will need to
* create multiple request objects, each with its own registered callbacks.
*
* ## Removing Default Listeners for Events
*
* Request objects are built with default listeners for the various events,
Expand Down Expand Up @@ -367,7 +371,7 @@ AWS.Request = inherit({

/**
* @!method promise()
* Returns a 'thenable' promise.
* Sends the request and returns a 'thenable' promise.
*
* Two callbacks can be provided to the `then` method on the returned promise.
* The first callback will be called if the promise is fulfilled, and the second
Expand Down Expand Up @@ -542,8 +546,8 @@ AWS.Request = inherit({
},

/**
* Converts the request object into a readable stream that
* can be read from or piped into a writable stream.
* Sends the request and converts the request object into a readable stream
* that can be read from or piped into a writable stream.
*
* @note The data read from a readable stream contains only
* the raw HTTP body contents.
Expand Down
2 changes: 1 addition & 1 deletion tasks/browser.rake
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace :browser do
task :setup_dist_tools do
unless File.directory?("dist-tools/node_modules")
Dir.chdir('dist-tools') do
sh "npm install --production"
sh "npm install"
end
end
end
Expand Down

0 comments on commit 43ee1fc

Please sign in to comment.