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 8872593 commit 210714b
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 51 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"author": "Ma Bingyao <[email protected]>",
"name": "hprose",
"version": "2.0.28",
"version": "2.0.29",
"description": "Hprose is a High Performance Remote Object Service Engine.",
"keywords": [
"hprose",
Expand Down
12 changes: 6 additions & 6 deletions dist/hprose.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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

Large diffs are not rendered by default.

24 changes: 8 additions & 16 deletions dist/hprose.src.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Hprose for JavaScript v2.0.28
// Hprose for JavaScript v2.0.29
// Copyright (c) 2008-2016 http://hprose.com
// Hprose is freely distributable under the MIT license.
// For all details and documentation:
Expand Down Expand Up @@ -1734,7 +1734,7 @@ hprose.global = (
* *
* hprose Future for JavaScript. *
* *
* LastModified: Nov 24, 2016 *
* LastModified: Dec 5, 2016 *
* Author: Ma Bingyao <[email protected]> *
* *
\**********************************************************/
Expand Down Expand Up @@ -2037,7 +2037,7 @@ hprose.global = (
}

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

var future = new Future();
Expand Down Expand Up @@ -4817,7 +4817,7 @@ hprose.global = (
* *
* hprose client for JavaScript. *
* *
* LastModified: Nov 18, 2016 *
* LastModified: Dec 5, 2016 *
* Author: Ma Bingyao <[email protected]> *
* *
\**********************************************************/
Expand Down Expand Up @@ -5851,9 +5851,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 @@ -5862,9 +5860,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 @@ -5873,9 +5869,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 @@ -5884,9 +5878,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
12 changes: 6 additions & 6 deletions example/hprose.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hprose-js",
"version": "2.0.28",
"version": "2.0.29",
"description": "Hprose is a High Performance Remote Object Service Engine.",
"homepage": "https://github.com/hprose/hprose-js",
"keywords": [
Expand Down
18 changes: 5 additions & 13 deletions src/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* *
* hprose client for JavaScript. *
* *
* LastModified: Nov 18, 2016 *
* LastModified: Dec 5, 2016 *
* Author: Ma Bingyao <[email protected]> *
* *
\**********************************************************/
Expand Down Expand Up @@ -1046,9 +1046,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 @@ -1057,9 +1055,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 @@ -1068,9 +1064,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 @@ -1079,9 +1073,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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Hprose for JavaScript v2.0.28
// Hprose for JavaScript v2.0.29
// Copyright (c) 2008-2016 http://hprose.com
// Hprose is freely distributable under the MIT license.
// For all details and documentation:
Expand Down
Loading

0 comments on commit 210714b

Please sign in to comment.