[Proposal] POEM: provide array result for all runtime images#5244
[Proposal] POEM: provide array result for all runtime images#5244ningyougang merged 3 commits intoapache:masterfrom
Conversation
dd68177 to
07f4d98
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5244 +/- ##
==========================================
- Coverage 79.97% 75.27% -4.70%
==========================================
Files 238 238
Lines 14199 14199
Branches 577 577
==========================================
- Hits 11355 10689 -666
- Misses 2844 3510 +666 ☔ View full report in Codecov by Sentry. |
|
Hi,guys. I updated the split.js and sort.js like below and invoked successully using my local openwhisk codes function main(msg) {
var separator = msg.separator || /\r?\n/;
var payload = msg.payload.toString();
var lines = payload.split(separator);
return lines;
}And function main(msg) {
var lines = msg || [];
console.log('sort before: ' + lines);
lines.sort();
return lines;
} |
07f4d98 to
ec27073
Compare
| --> | ||
| # Title | ||
|
|
||
| Currently, openwhisk supports return json object only, e.g. |
There was a problem hiding this comment.
| Currently, openwhisk supports return json object only, e.g. | |
| Currently, OpenWhisk supports returning a JSON object only, e.g. |
There was a problem hiding this comment.
Updated accordingly
| "greeting": "Hello stranger!" | ||
| } | ||
| ``` | ||
| It is necessary to support return array for common action, e.g. |
There was a problem hiding this comment.
| It is necessary to support return array for common action, e.g. | |
| It is necessary to support returning an array too as an array is also a proper JSON object, e.g. |
There was a problem hiding this comment.
Updated accordingly
| "b" | ||
| ] | ||
| ``` | ||
| For sequence action, need to support as well. |
There was a problem hiding this comment.
| For sequence action, need to support as well. | |
| The sequence action should be considered as well. |
There was a problem hiding this comment.
Updated accordingly
|
|
||
| # Summary and Motivation | ||
|
|
||
| This POEM proposes a new feature that allows user to write their own action which supports array result. |
There was a problem hiding this comment.
| This POEM proposes a new feature that allows user to write their own action which supports array result. | |
| This POEM proposes a new feature that allows user to write their own action which supports an array result. |
There was a problem hiding this comment.
Updated accordingly
| # Summary and Motivation | ||
|
|
||
| This POEM proposes a new feature that allows user to write their own action which supports array result. | ||
| So the result will support object and array both in future. |
There was a problem hiding this comment.
| So the result will support object and array both in future. | |
| So actions would be able to return a JSON object or an array. |
There was a problem hiding this comment.
Updated accordingly
| Make controller and invoker support array result both. | ||
|
|
||
| ## Runtime repos | ||
| All runtime images should support array result. e.g. |
There was a problem hiding this comment.
| All runtime images should support array result. e.g. | |
| All runtime images should support an array result. e.g. |
There was a problem hiding this comment.
Updated accordingly
|
|
||
| # Proposed changes | ||
| ## Openwhisk main repo | ||
| Make controller and invoker support array result both. |
There was a problem hiding this comment.
| Make controller and invoker support array result both. | |
| Make controller and invoker support both a JSON object and an array result. |
| * ballerina | ||
|
|
||
| ## Openwhisk-cli repo | ||
| * When use wsk to execute action, need to support parse array result. |
There was a problem hiding this comment.
| * When use wsk to execute action, need to support parse array result. | |
| * The `wsk` CLI needs to support parsing an array result when executing actions. |
There was a problem hiding this comment.
Updated accordingly
|
|
||
| ## Openwhisk-cli repo | ||
| * When use wsk to execute action, need to support parse array result. | ||
| * When use wsk to get activation, need to support parse array result as well. |
There was a problem hiding this comment.
| * When use wsk to get activation, need to support parse array result as well. | |
| * The `wsk` CLI needs to support parsing an array result when getting activations. |
There was a problem hiding this comment.
Updated accordingly
ec27073 to
7166b6f
Compare
7166b6f to
d4899a6
Compare
|
Have any more comment? |
Description
This is the POEM documentation for new feature providing
support array result for all runtime imagesI refer to this guide document for POEM: https://github.com/apache/openwhisk/blob/master/proposals/README.md
Related issue and scope
My changes affect the following components
Types of changes
Checklist: