Skip to content

Commit

Permalink
Added coroutine middleware support.
Browse files Browse the repository at this point in the history
  • Loading branch information
andot committed Dec 5, 2016
1 parent 1c11d24 commit 48e7925
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 37 deletions.
2 changes: 1 addition & 1 deletion bower.json
@@ -1,7 +1,7 @@
{
"author": "Ma Bingyao <andot@hprose.com>",
"name": "hprose-html5",
"version": "2.0.30",
"version": "2.0.31",
"description": "Hprose is a High Performance Remote Object Service Engine.",
"keywords": [
"hprose",
Expand Down
8 changes: 4 additions & 4 deletions dist/hprose-html5.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/hprose-html5.min.js

Large diffs are not rendered by default.

24 changes: 8 additions & 16 deletions dist/hprose-html5.src.js
@@ -1,4 +1,4 @@
// Hprose for HTML5 v2.0.30
// Hprose for HTML5 v2.0.31
// Copyright (c) 2008-2016 http://hprose.com
// Hprose is freely distributable under the MIT license.
// For all details and documentation:
Expand Down Expand Up @@ -1098,7 +1098,7 @@ hprose.global = (
* *
* hprose Future for HTML5. *
* *
* LastModified: Nov 24, 2016 *
* LastModified: Dec 5, 2016 *
* Author: Ma Bingyao <andot@hprose.com> *
* *
\**********************************************************/
Expand Down Expand Up @@ -1398,7 +1398,7 @@ hprose.global = (
}

if (!gen || typeof gen.next !== 'function') {
return toPromise(gen);
return toFuture(gen);
}

var future = new Future();
Expand Down Expand Up @@ -4061,7 +4061,7 @@ hprose.global = (
* *
* hprose client for HTML5. *
* *
* LastModified: Nov 18, 2016 *
* LastModified: Dec 5, 2016 *
* Author: Ma Bingyao <andot@hprose.com> *
* *
\**********************************************************/
Expand Down Expand Up @@ -5099,9 +5099,7 @@ hprose.global = (
_invokeHandler = _invokeHandlers.reduceRight(
function(next, handler) {
return function(name, args, context) {
return Future.sync(function() {
return handler(name, args, context, next);
});
return Future.toPromise(handler(name, args, context, next));
};
}, invokeHandler);
}
Expand All @@ -5110,9 +5108,7 @@ hprose.global = (
_batchInvokeHandler = _batchInvokeHandlers.reduceRight(
function(next, handler) {
return function(batches, context) {
return Future.sync(function() {
return handler(batches, context, next);
});
return Future.toPromise(handler(batches, context, next));
};
}, batchInvokeHandler);
}
Expand All @@ -5121,9 +5117,7 @@ hprose.global = (
_beforeFilterHandler = _beforeFilterHandlers.reduceRight(
function(next, handler) {
return function(request, context) {
return Future.sync(function() {
return handler(request, context, next);
});
return Future.toPromise(handler(request, context, next));
};
}, beforeFilterHandler);
}
Expand All @@ -5132,9 +5126,7 @@ hprose.global = (
_afterFilterHandler = _afterFilterHandlers.reduceRight(
function(next, handler) {
return function(request, context) {
return Future.sync(function() {
return handler(request, context, next);
});
return Future.toPromise(handler(request, context, next));
};
}, afterFilterHandler);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "hprose-html5",
"version": "2.0.30",
"version": "2.0.31",
"description": "Hprose is a High Performance Remote Object Service Engine.",
"homepage": "https://github.com/hprose/hprose-html5",
"keywords": [
Expand Down
18 changes: 5 additions & 13 deletions src/Client.js
Expand Up @@ -12,7 +12,7 @@
* *
* hprose client for HTML5. *
* *
* LastModified: Nov 18, 2016 *
* LastModified: Dec 5, 2016 *
* Author: Ma Bingyao <andot@hprose.com> *
* *
\**********************************************************/
Expand Down Expand Up @@ -1050,9 +1050,7 @@
_invokeHandler = _invokeHandlers.reduceRight(
function(next, handler) {
return function(name, args, context) {
return Future.sync(function() {
return handler(name, args, context, next);
});
return Future.toPromise(handler(name, args, context, next));
};
}, invokeHandler);
}
Expand All @@ -1061,9 +1059,7 @@
_batchInvokeHandler = _batchInvokeHandlers.reduceRight(
function(next, handler) {
return function(batches, context) {
return Future.sync(function() {
return handler(batches, context, next);
});
return Future.toPromise(handler(batches, context, next));
};
}, batchInvokeHandler);
}
Expand All @@ -1072,9 +1068,7 @@
_beforeFilterHandler = _beforeFilterHandlers.reduceRight(
function(next, handler) {
return function(request, context) {
return Future.sync(function() {
return handler(request, context, next);
});
return Future.toPromise(handler(request, context, next));
};
}, beforeFilterHandler);
}
Expand All @@ -1083,9 +1077,7 @@
_afterFilterHandler = _afterFilterHandlers.reduceRight(
function(next, handler) {
return function(request, context) {
return Future.sync(function() {
return handler(request, context, next);
});
return Future.toPromise(handler(request, context, next));
};
}, afterFilterHandler);
}
Expand Down
2 changes: 1 addition & 1 deletion src/CopyRight.js
@@ -1,4 +1,4 @@
// Hprose for HTML5 v2.0.30
// Hprose for HTML5 v2.0.31
// Copyright (c) 2008-2016 http://hprose.com
// Hprose is freely distributable under the MIT license.
// For all details and documentation:
Expand Down

0 comments on commit 48e7925

Please sign in to comment.