async-rails 2.4.0 → 2.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/async-rails/version.rb +1 -1
- data/vendor/assets/javascripts/async.js +21 -22
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '08e5cb75601fccd33a0d462ab6785d14db141f29'
|
4
|
+
data.tar.gz: eaf38a840d3aceb791c3b932c45a3c402853c00a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0207565ddaee5781e7de430a6c4263a469ee1416b5d450ee6f7d3d9bb5ee9af964e9d191512cfe4c43d794e8f549762d720448f1336eae2c6b80858124582173
|
7
|
+
data.tar.gz: 95bcac0ca71e890834604b876128d160ae1e879665253e66b0fb91ba21f77cf4415e3872689aa90e50f6416ef005a92d0df0394e7c74200e2304b4b9828257d8
|
data/lib/async-rails/version.rb
CHANGED
@@ -4868,34 +4868,33 @@ function sortBy (coll, iteratee, callback) {
|
|
4868
4868
|
* });
|
4869
4869
|
*/
|
4870
4870
|
function timeout(asyncFn, milliseconds, info) {
|
4871
|
-
var
|
4872
|
-
var timedOut = false;
|
4873
|
-
|
4874
|
-
function injectedCallback() {
|
4875
|
-
if (!timedOut) {
|
4876
|
-
originalCallback.apply(null, arguments);
|
4877
|
-
clearTimeout(timer);
|
4878
|
-
}
|
4879
|
-
}
|
4871
|
+
var fn = wrapAsync(asyncFn);
|
4880
4872
|
|
4881
|
-
function
|
4882
|
-
var
|
4883
|
-
var
|
4884
|
-
|
4885
|
-
|
4886
|
-
|
4873
|
+
return initialParams(function (args, callback) {
|
4874
|
+
var timedOut = false;
|
4875
|
+
var timer;
|
4876
|
+
|
4877
|
+
function timeoutCallback() {
|
4878
|
+
var name = asyncFn.name || 'anonymous';
|
4879
|
+
var error = new Error('Callback function "' + name + '" timed out.');
|
4880
|
+
error.code = 'ETIMEDOUT';
|
4881
|
+
if (info) {
|
4882
|
+
error.info = info;
|
4883
|
+
}
|
4884
|
+
timedOut = true;
|
4885
|
+
callback(error);
|
4887
4886
|
}
|
4888
|
-
timedOut = true;
|
4889
|
-
originalCallback(error);
|
4890
|
-
}
|
4891
4887
|
|
4892
|
-
|
4888
|
+
args.push(function () {
|
4889
|
+
if (!timedOut) {
|
4890
|
+
callback.apply(null, arguments);
|
4891
|
+
clearTimeout(timer);
|
4892
|
+
}
|
4893
|
+
});
|
4893
4894
|
|
4894
|
-
return initialParams(function (args, origCallback) {
|
4895
|
-
originalCallback = origCallback;
|
4896
4895
|
// setup timer and call original function
|
4897
4896
|
timer = setTimeout(timeoutCallback, milliseconds);
|
4898
|
-
fn.apply(null, args
|
4897
|
+
fn.apply(null, args);
|
4899
4898
|
});
|
4900
4899
|
}
|
4901
4900
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: async-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Chen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|