ningyougang commented on PR #129:
URL:
https://github.com/apache/openwhisk-runtime-python/pull/129#issuecomment-1193797269
Python supports sequence action by default with support array result, test
steps as below
* Write split.py and sort.py
```py
[root@nccddev130026 ~]# cat ~/split.py
def main(args):
payload = args.get("payload", "aaaa\nbbbb\nccccc")
separator = args.get("separator", "\n")
result = payload.split(separator)
return result
[root@nccddev130026 ~]# cat ~/sort.py
def main(args):
if args is None:
args = ["data1", "data2", "data3"]
result = args[::-1]
return result
```
* Create action and invoke it (python:3.7/3.9 both tested, worked well both)
```shell
wsk -i action create /whisk.system/utils/split-python --kind python:3.7
~/split.py
wsk -i action create /whisk.system/utils/sort-python --kind python:3.7
~/sort.py
wsk -i action create mySequence-python --sequence
/whisk.system/utils/split-python,/whisk.system/utils/sort-python
wsk -i action invoke --result mySequence-python --param payload
"dddd\nbbbb\ncccc\nfffffff\nggggggggg" -r -v
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]